Note that there are some explanatory texts on larger screens.

plurals
  1. POMime type for zip file in Google Chrome
    primarykey
    data
    text
    <p>I discovered a weird issue in zip file's mime type when I worked on <a href="https://stackoverflow.com/questions/852017/set-mimetypes-not-working-for-zip-file-in-symfony">a Symfony application</a>. </p> <p>According to <a href="http://www.w3schools.com/media/media_mimeref.asp" rel="nofollow noreferrer">w3school</a>, the mime type for zip file is <code>application/zip</code>. This is what I believe, too.</p> <p>But when I upload a zip file in my Symfony app with IE, the mime type of that zip file is <code>application/x-zip-compressed</code>. When I upload a zip file in Firefox, the mime type of that zip file is <code>application/octet-stream</code>.</p> <p>None of them is <code>application/zip</code> as I would like to believe. </p> <p>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 <strong><em>am</em></strong> pretty sure that it's <strong><em>not</em></strong></p> <pre><code>application/zip application/x-zip application/octet-stream application/x-zip-compressed </code></pre> <p>The mime type for zip file in Google Chrome is an empty string, as I found out by dumping out the <code>sfValidatorFile</code> object returned. Note the <code>sfValidatorFile.type</code> is "" for zip file. </p> <p>But the <code>sfValidatorFile.type</code> object returned for a jpeg file is <code>jpeg</code>. </p> <p>Seems to me like there is a bug in either Symfony or Google Chrome</p> <p>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.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload