I've been doing this:
{!URLFOR($Resource.file,'0.jpg')}
to reference from a visual force page a static resource inside a zip file, there are some files 0.jpg, 1.jpg, etc. at the top level of the zip file but is beyond me why is not working (by this I mean, the image is not showing in the page). If someone can enlighten me about it, I would appreciate.
Update
I have a page construct as this:
<apex:page standardController="Contact" docType="html-5.0" standardStylesheets="false" cache="true" applyBodyTag="false" recordSetVar="contacts" extensions="Some_Ext">
<head>
<apex:styleSheet value="{!$Resource.style}"/>
</head>
<body>
<apex:form>
<apex:image value="{!URLFOR($Resource.resourcename, '0.jpg')}"/>
</apex:form>
</body>
</apex:page>
Note
The problem was that the image was a .png not a .jpg as I was referencing in the VF Page.
¡Be completely sure of the path and file EXTENSION when referencing a Static Resource!
Best Answer
Check this documentation
https://www.salesforce.com/us/developer/docs/pages/Content/pages_resources_reference.htm
(OR) if 1 is too confusing save the CSS/ JS/ Image or be it anything as a seperate static resource and reference it in VF page as
I usually prefer the second method since I have never been comfortable with zip file and extending the path.
Update:
My ZIP file content:
The page saves even though u do not have the closing } bracket, check if you have formed the image tag and closed the { and } for the URLFOR function.
Make sure the syntax is correct for the image tag as well as the URLFOR.
My output was :
![enter image description here][3]
UPDATE 2: