Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

I have created a .rar using winrar that contains images and upload as a static resource, but when i tried to access the images they are not displaying on my vf pages. I looked in "View Page Source" rendered HTML and clicked the rendered resource link and it displays in a blank page with black background with the following error,

The image "view-source:c.na15.visual.force.com/resource/1400088230000/UtilityImages/…; cannot be displayed because it contains errors.

After that, i created a zip file using winzip and do the same procedure as above and got it worked. Now my questions are,

  1. Is static resources recognize the files with only .zip?
  2. What are the other zip formats it will accept? (.rar, .jar, .ear, .tar, etc)

Any suggestions please.

share|improve this question

2 Answers 2

up vote 10 down vote accepted

The only accepted formats are .jar and .zip

You can package a collection of related files into a directory hierarchy and upload that hierarchy as a .zip or .jar archive.

https://www.salesforce.com/us/developer/docs/pages/Content/pages_resources.htm

share|improve this answer
2  
Note that a JAR is actually a ZIP with a renamed extension. It's use is for Java, of course, but in all other aspects, it is formatted as a normal ZIP file. –  sfdcfox May 15 at 14:14

As far as I used .zip and without any issue. In salesforce documentations also they have mentioned that .zip and .jar will work but nothing mentioned about .rar

If you are using WinZip make sure you are using the latest version since salesforce has announced it may loss your data with older versions.

If you are using WinZip be sure to install the most recent version. Older versions of WinZip may cause a loss of data.

share|improve this answer
    
i have given upvote for your answer @highfive –  Baskaran S May 16 at 18:25

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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