Hello All
I am using RadAsyncUpload and using a custom HTTPHandler and inserting the files directly to DB. Before inserting I am checking for the MIME Type of the file. I am getting the MIME type from Uploadedfile.ContentType. This is returning NULL for .zip file.I am using IE 10 and the version of Telerik is 2014.3.1024.35
Any help is much appreciated.
Thanks
Rakesh
6 Answers, 1 is accepted
0
Hi Rakesh,
Are you using Google Chrome? This look like a bug in Chrome. It can be reproduced with the following hmtl:
I have logged this issue to Google - Web API Blob.Type returns empty mime type when zip file is selected.
But this what is more interesting here is that IE10/11 also returns empty mime type for zip files.
Regards,
Hristo Valyavicharski
Telerik
Are you using Google Chrome? This look like a bug in Chrome. It can be reproduced with the following hmtl:
<!DOCTYPE html>
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
>
<
title
></
title
>
</
head
>
<
body
>
<
div
>
Select .zip file.
</
div
>
<
input
type
=
"file"
id
=
"fileInput"
onchange
=
"fileSelected()"
/>
<
script
type
=
"text/javascript"
>
function fileSelected() {
var input = document.getElementById('fileInput');
var file = input.files[0];
alert(file.type);
}
</
script
>
</
body
>
</
html
>
I have logged this issue to Google - Web API Blob.Type returns empty mime type when zip file is selected.
But this what is more interesting here is that IE10/11 also returns empty mime type for zip files.
Regards,
Hristo Valyavicharski
Telerik
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Feedback Portal
and vote to affect the priority of the items
0

Rakesh
Top achievements
Rank 1
answered on 20 Jul 2015, 11:00 AM
Hi Hristo
Thank you for the reply. I didn't try it in Chrome. But this is happening in IE10. Looks like you too have the same issue in IE10/11. Do you have any alternative approach for this?
Thanks
Rakesh
0
No unfortunatelly. But you could try to get the content type by the file extension.
Regards,
Hristo Valyavicharski
Telerik
Regards,
Hristo Valyavicharski
Telerik
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Feedback Portal
and vote to affect the priority of the items
0

Rakesh
Top achievements
Rank 1
answered on 20 Jul 2015, 11:43 AM
I have the extension. But I need the MIME type for some validation.
0
Accepted
Since this is a bug in browser's File API implementation try to disable the AsyncUpload File API module:
I hope this helps.
Regards,
Hristo Valyavicharski
Telerik
<
telerik:RadAsyncUpload
runat
=
"server"
ID
=
"upload"
DisablePlugins
=
"true"
HttpHandlerUrl
=
"~/AsyncHandler.ashx"
></
telerik:RadAsyncUpload
>
<
script
type
=
"text/javascript"
>
Telerik.Web.UI.RadAsyncUpload.Modules.FileApi.isAvailable = function () { return false; }
</
script
>
I hope this helps.
Regards,
Hristo Valyavicharski
Telerik
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Feedback Portal
and vote to affect the priority of the items
0

Rakesh
Top achievements
Rank 1
answered on 20 Jul 2015, 02:50 PM
This is working perfect in IE10. I am not sure how this behaves in chrome. Thank you for the help.
Thanks
Rakesh