This is a migrated thread and some comments may be shown as answers.

Detecting contenttype of .msg files

4 Answers 374 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 04 Mar 2015, 05:48 PM
Hi,

We are using RadAsyncUpload and saving the ContentType property of the uploaded file.

For most uploaded files, .pdf, .docx etc. the ContentType property has been detected.

When uploading an .msg file the ContentType property is null.

Is this an known issue? Do you have any suggestions?

Thanks.

4 Answers, 1 is accepted

Sort by
0
Boyan Dimitrov
Telerik team
answered on 09 Mar 2015, 05:02 PM
Hello,

The reason for this behavior is because this file format is not part of the MIME type list. The file format needs to be part of that list in order the ContentType to be set properly. You can replicate same issue with the <input type="file" name="file upload">. 

Regards,
Boyan Dimitrov
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.

 
0
Michael
Top achievements
Rank 2
Iron
Iron
Iron
answered on 05 Aug 2015, 07:00 PM
This is not correct - up until very recently we were able to upload .msg files just fine so either somebody took .msg away as a valid MIME type or something changed with the RadAsyncUpload control because the MVC version of the control works just fine.
0
Hristo Valyavicharski
Telerik team
answered on 07 Aug 2015, 05:48 AM
Hi Michael,

Please read this post:
http://www.telerik.com/forums/msg-file-contenttype-null#9iRDuIFJY0mg37UVXuuspA

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
Dani
Top achievements
Rank 1
answered on 23 Sep 2020, 09:04 PM

I tried different ways, not all in the code snippet:
Java 7 Files.probeContentType(path)
URLConnection mime detection from file name and content type guessing
JDK 6 JAF API javax.activation.MimetypesFileTypeMap
MimeUtil with all available subclass of MimeDetector I found
Apache Tika
Apache POI scratchpad
check it https://glensley.doodlekit.com

Tags
AsyncUpload
Asked by
David
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
Michael
Top achievements
Rank 2
Iron
Iron
Iron
Hristo Valyavicharski
Telerik team
Dani
Top achievements
Rank 1
Share this question
or