asyncUpload.UploadedFiles[0].ContentType return null when png file uploaded.
please fix it.
<%@ Page Language="C#" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="Telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
protected void show(object sender, EventArgs e)
{
if (asyncUpload.UploadedFiles.Count != 0)
label.Text = asyncUpload.UploadedFiles[0].ContentType;
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form" runat="server">
<div>
<Telerik:RadScriptManager ID="radScriptManager" runat="server" />
<Telerik:RadAsyncUpload runat="server" ID="asyncUpload"
MaxFileInputsCount="1" />
<asp:Button ID="button" runat="server" Text="show content type" OnClick="show" />
<br />
<asp:Label ID="label" runat="server" Text="Label" />
</div>
</form>
</body>
</html>
thanks
10 Answers, 1 is accepted
I have tested your sample code(with the latest version of our control) and everything works fine on my side. Please review the following video. Also please clarify which version of our control are you using.
All the best,
Peter Filipov
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
my telerik version is 2011.1.315.40
but this bug fixed in telerik v2011.2.725.40
thank you
I'm using Telerik.Web.UI.dll version 2013.2.717.40
I understand that more information is required but I don't have any at the time being. Still working on it.
@mehdi You need to update in order to get fix. It is not possible to workaround the issue.
@Sergey Let me know if you have more information on the case.
Regards,
Peter Filipov
Telerik
Build cross-platform mobile apps using Visual Studio and .NET. Register for the online webinar on 03/27/2014, 11:00AM US ET.. Seats are limited.
Here is what I could get:
UserAgent: Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0)
Browser: IE
ctl00_radMenu_ClientState:
ctl00_radSiteMap_ClientState:
ctl00_cphMain_rupAttachments_ClientState: {'isEnabled':'true','uploadedFiles':[{"fileInfo":{"FileName":"Report.pdf","ContentType":null,"ContentLength":1166749,"DateJson":"2014-04-14T03:18:10.535Z","Index":0},"metaData":"CS8S/Z0J/b2982DRxDin0BBslA7fI0cWMuWlPu4W3Fkgs5pAFT6RZN0tb47n/Omv60yhBUd+BWPJIxe/r9SZ3cq2LirvbObvVOs9AhvhP3SH8EGe0Y6xh6pIrehjL2+nm3jHBLh6kfebVTvf6HrIUkRae8FOD8YhYMTE+sFPCUDmIE0CQmzF7R2o52PagErwXymvOAm49GjGrjPVgkm/5giSHPwMlpex/lY9KTAjHj02Fc3BtYzb3yCEJBjXqwcF/rk6dy0+BH5lnrU8dlG9GsVbflH7+0p8Ia7dEWQ1y7wuS6X05kedPE2qpAh6vo5n+5ct7B5CGYCJfyzVcskQ9HrRPnN1MVWTpBHGOj+dej5+YZi5zUU7hXhEu266FtRox2d3adp/aNTVwaIRYL78ipi4U9PRr9Ag9Er3UkuJIPLMqrr6tyaFbdEwBWeKMt6ipQmRC5lTa9MCA6BxOvJ4+2gOZXL3zS2uhdB74og9SWrvnEeqKiyGLQ4fgfCvaFur7mb2nkFPSxup7l+RUSN2MwOBo7U6eteVsNcdi1e4Xyk="}]}
I have no idea how this happens. They've tried different files and it's always the same. It could be something with the client's browser.
I have tested to upload a pdf file under IE10 and the returned content type is the correct one. Does the issue exists for the user under different browser? Do you use a custom handler?
Regards,
Peter Filipov
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
No, I don't use a custom handler.
It happened for couple of other users. Here is some info about their systems:
UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.3; WOW64; Trident/7.0; .NET4.0E; .NET4.0C; .NET CLR 3.5.30729; .NET CLR 2.0.50727; .NET CLR 3.0.30729)
UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.2; WOW64; Trident/6.0; Touch; .NET4.0E; .NET4.0C; .NET CLR 3.5.30729; .NET CLR 2.0.50727; .NET CLR 3.0.30729; Tablet PC 2.0; HPDTDFJS)
ctl00_cphMain_rupAttachments_ClientState: {'isEnabled':'true','uploadedFiles':[{"fileInfo":{"FileName":"Report.PDF","ContentType":null,"ContentLength":382599,"DateJson":"2014-04-22T17:42:50.565Z","Index":0},"metaData":"CS8S/Z0J/b2982DRxDin0BBslA7fI0cWMuWlPu4W3FmIgh1kJLpmV/tNKc1jkGTbHDWsrJY3QT0Y8S+ofQjRLSf2+ohBUVq6xFpEJCL8w7b8jQ0Xjat1NshNQgoqhJsSp4pQ2wWOQeu9evmRHr2d60URUvYCdO4uH/Y+6JVP1RFJGqLaC987Qu/QxX+P8HqhlZJR/mPYt612xF9YHQfJxni+Ch7uLSyWhQ4LPzIHFidPRADnJ7YFjFO2iJFYLL87sP9uK89RvGugv7MwX1cEscXhHKD97UoELMZZ46pHmvJuBHkMwu54s6ACrt4zcgTWbFPjbioBlUoMQ11prI6uM8BVtvoZpB6xQ5k+ZsSHYKTDSdDwl5gfGi+OQ4zmsM6cNdmLVyrPxC2dWgeVpkmvOYiABIj5mTQUI2JN5V3u8bJnzkzAMzkMZM0S6Lc6Ca5DRGu+I11DOMHLOjysU6B+z9MYTmFVdrz1HC6Rp/U7+6PisCct8o5NiOiMfaz6YYn9"},{"fileInfo":{"FileName":"4096 INV.PDF","ContentType":null,"ContentLength":43464,"DateJson":"2014-04-22T17:40:22.599Z","Index":1},"metaData":"CS8S/Z0J/b2982DRxDin0BBslA7fI0cWMuWlPu4W3FmIgh1kJLpmV/tNKc1jkGTbCyPR/icMqGEpM5l9hu0iYcz282ymGmjo559eYix/JRw3sKDJhnU2GVsHvtrs96pxHqIxbHmewE7pynqtP29VjEVJ5GluSRMIKO6xxz6gU6Zrs5rGIwl6UQT6oWhevRTewudXF/UiGJnyd30kuscMcSD5DY1/hLxfT+PRooFgFeR6nJOgc07G5phCcmMJMLm+2Xc3ryGtnLIsTZ9qYkPKmOMTKl/GMXUWrPSwplUAASRpNjlfGmdLq8GwsuDwh3JbSFopBouo0cLKZvipJWahMJohBG2RDl6IMq/wALpRZtkjNjY02umeGj1AydGCJxF5cZps+h4E0HlT3XGkLp/oHSDxnurBg0H6QSN1p0yh/FMLpk3+dBRfWm9SGJ2C9p/JmQnoBvGywU+rdK4Q2KLRGpd+Sk7LcGfy9rSUQWZkMJu89thh1hIrhcbqQTKGWF3H"}]}
As you can see browser sends "ContentType":null. They've emailed me the files they tried to upload and I didn't have any problems uploading them myself. So the files aren't corrupted.
Here is how I define the control:
<telerik:RadAsyncUpload ID="rupAttachments" runat="server" ControlObjectsVisibility="RemoveButtons, AddButton"
ReadOnlyFileInputs="True" AllowedFileExtensions=".pdf,.xml" OnClientAdded="OnClientAddedHandler"
OnClientFileUploadRemoving="OnClientFileUploadRemoving" OnClientFileUploadRemoved="OnClientFileUploadRemoved"
TemporaryFileExpiration="01:00:00" OnClientValidationFailed="OnClientValidationFailed">
</telerik:RadAsyncUpload>
I don't know what other information can be helpful in this case. And I don't have access to the clients' machines to test it myself.
It's not a major issue for us as there is an easy workaround by checking that property for null. But there is definitely an issue with RadAsyncUpload control.
It is really strange behavior. Probably it is related with some custom configuration of the IE. Until now, we haven't a report with similar problem. Please contact us if you reproduce the problem.
Regards,
Peter Filipov
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
Hi Peter,
Seems like the problem still exists,
Telerik web.ui.dll = Version 2015.1.225.45
USER AGENT: Browser (IE 11.0 on a Personal computer running Windows 8.1)
ctl00_Content_rAuploadFiles_ClientState={'isEnabled':'true','uploadedFiles':[{"fileInfo":{"FileName":"Quitclaim Deed.pdf","ContentType":null,"ContentLength":37096,"DateJson":"2015-11-02T09:03:02.000Z","Index":1},"metaData":"CS8S/Z0J/b2982DRxDin0BBslA7fI0cWMuWlPu4W3FnoQnMpAWnR8xIUC0anTz15N9+gMmYHuCHwSwJEH8OUUx3bmkvObBVNbFZShC+73O+by1E5KPLZCrAXLtngvgyZUx8I16wL3JvZj9xKtdTSkP4E9Cf/ywU5pEsY9JaAY01QhYtalNqfs40pgtxeLV7nMSwcC0QKqO+sGa14At3Js2SJZxKYDGCByHXmQsZY07WHwWVYATsPLleYFBhmeJ5FGdssWHNdq+v8MoJZ1jgWRIk66mpLYX1h/ZGB4CUmJ9lVlaxBrEh/yNgr8WuZB7eEAt1dnU/6tucqX25IdsSZerwhAw3WmnYvzwgsh5xv6ocq8nRPC8v1f3e8qPe0mruFXQ5Yx3ojH1S5PwzZhF0Hs1bCnrjqxDOS+7Dsq5OiVmRlXgqZr4zzAObIV/eUX2KYtW8NnIiS2yqVujNWOwguAFOq1q+cdw+59tke4ofRAyVGQ+OdPguyLxXmxgQc3pNtbYH2qxDjIL8cwYMmLV69Tg=="}]}
We deployed and tested the sample scenario that you described with multiple files of different types, but at our end the behavior with the ContentType returning null was not reproduced. Could you provide more details whether the issue can be observed in all browsers or it is browser-specific s owe could be more helpful?
Regards,
Plamen
Telerik