Skip to Content
0
Former Member
Jul 16, 2008 at 05:01 AM

How to find if the uloaded file is a zip file

63 Views

Hello everyone,

I am currently implementing a filter in my code where I put a restriction that allows only a certain type of files to be accepted. One of them is the zip file type.

However, when I tried to read the mimetype of this zip file using the folloing API :

IWDResource.getResourceType().getHtmlMime(),

I get "application/octet-stream" which is the mime type of any binary file, and not "application/zip" which is the usual zip file mimetype.

Therefore it is difficult to identify whether the uploaded file is a zip file which we can operate on accordingly.

I need to know whether there is some way I can acheive this?