How to use a static resource to display an image on a visualforce page?

601    Asked by ClareMatthews in Salesforce , Asked on May 4, 2023

I have uploaded an image to a static resource. I just want to display it on the visual force component . i tried this way

but the image still is not rendering in the UI.

Answered by David EDWARDS

The answer to your question - How to use a static resource to display an image on a visualforce page is -

The reason why the image doesn't show up in the email is because value="{!$Resource.myResourceImage}" generates a relative URL from which the image is rendered (i.e. "/resource/1312483024000/logo"). This URL is accessible only for authenticated platform users.

To solve this problem, images should be stored in documents and with "Externally Available Image" checked. The image will be available by using the following markup:



Your Answer

Interviews

Parent Categories