I'm trying to upload a zip file in static resources. Even after selecting a .zip file to upload , the uploaded document is displaying mime type as application/octet-stream instead of application/zip.

I even tried to change the mime type through developer console but got error stating the file is not a valid zip file.

Error : The specified Static Resource is not a valid zip file: Body

Uploaded document developer console error Mime type display after zip file upload

  • Its weird after removing 'body' from the query and then changing the mine type from dev console worked. – Cyclotron3x3 Sep 25 '16 at 9:21
  • Can you now access the static resource content? Are you sure that the static resource contains ZIP format and not some other format? – Keith C Sep 25 '16 at 11:24

Really application/zip or application/octet-stream mime type does not meters to access the static resources from the zip in visual force. But anyway this depends on the program you are using to create the zip file and the browser you are using.

If you are using winrar to create the zip file and uploading it through chrome or firefox it will change mime-type to octet-stream. But if you will use internet explorer for uploading the zip. you will see the mime type will be application/x-zip-compress.


I don't have a specific response to this 2 years later, but I did want to chime in and mention that I've seen this too. We are working with an org that has lots of legacy customizations. I pulled down all the metadata and converted to DX format for easier browsing. But about half the ZIP static resources did not auto-unzip in the conversion because the platform considered them application/octet-stream instead of zip files. The ZIPs still work perfectly well as static resources. But SFDX gets confused.

Going forward, probably the best way to generate resource ZIPs will just be to work with them in DX which auto-handles the zip/unzipping on deployment. It also means you can now source-track the individual files of the ZIP as part of your release management.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.