1

I'm trying to reference a zipped icon in a VF like this:

<img src="{!URLFOR($Resource.icons,'clock.png')}" class="orgIcon" />

Where icons is the name that I give the static resource.

I've done this before without problem. Also was working in the same VF with other icons but since I've updated the zip file adding some new icons It has stopped working and I can't figure out why.

The Url generated is: https://pkgname.eu2.visual.force.com/resource/1410944742000/pkgname__icons/clock.png

But I get a 404 requesting that.

I'm sure that the updated zip file contains the clock.png.

I checked that all files are in root folder in the zip. I've also checked that icons/clock.png unsuccessfully

In addition I've checked that the MIME Type is application/zip

What is wrong ?

  • It is easy when creating or editing the ZIP file to get the folder structure wrong. I suggest you download the static resource from the org and unzip it to check its folder structure. Then correct if needed and re-upload. – Keith C Sep 17 '14 at 9:56
  • I checked that all files are in root folder in the zip. I've also checked that icons/clock.png unsuccessfully – jm-cloud Sep 17 '14 at 15:29
1

Finally it was a problem with the ZIP app that I was using.

I've only compressed those files using the standard os-x compressor and works.

Sorry for the inconvenient.

0

Looks like you should be using with the "icons" folder in the path.

<img src="{!URLFOR($Resource.icons,'icons/clock.png')}" class="orgIcon" />
  • I checked that all files are in root folder in the zip. I've also checked that icons/clock.png unsuccessfully. – jm-cloud Sep 17 '14 at 15:30
  • Usually when I get this as Keith says, it is just the folder structure that doesnt map to the url. You could also check the public/private control seting on the resource, if this in being used on a public site? – dacology Sep 19 '14 at 12:17

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.