I discovered a weird issue in zip file's mime type when I worked on a Symfony application.
According to w3school, the mime type for zip file is application/zip
. This is what I believe, too.
But when I upload a zip file in my Symfony app with IE, the mime type of that zip file is application/x-zip-compressed
. When I upload a zip file in Firefox, the mime type of that zip file is application/octet-stream
.
None of them is application/zip
as I would like to believe.
The weirdest behavior of all, is Google Chrome. When I upload a zip file in Google Chrome, I can't determine the correct mime type for it. Although I am pretty sure that it's not
application/zip
application/x-zip
application/octet-stream
application/x-zip-compressed
The mime type for zip file in Google Chrome is an empty string, as I found out by dumping out the sfValidatorFile
object returned. Note the sfValidatorFile.type
is "" for zip file.
But the sfValidatorFile.type
object returned for a jpeg file is jpeg
.
Seems to me like there is a bug in either Symfony or Google Chrome
Futher info: It seems that Gmail interprets zip file's mime type as application/zip in Google Chrome. This is the correct behavior. Seems to confirm that it's Symfony's bug.
Best Answer
As of now, MIME type of a zip file is application/octet-stream in Google Chrome. :)