function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Static Resources or documents made accessible outside SF without login

I started a Visualforce template where I call a Static Resource (just happens to be an image file) - it appears great in the preview, but when the e-mail is sent the user gets a red box instead of the picture.
Is it possible for static resources or documents to be available to non-sf users outside of salesforce? Can I use them in a visual force template or link via a URL without authentication?
In my template I call it using
<apex:image url="{!$Resource.LetterHead}" />


Message Edited by BrianWK on 12-30-2008 11:02 AM
Pretty sure you cannot do this in the current platform. However, Sites has a "cache control" feature of public resources which allows you to mark them as "public" to achieve what you are trying to do.

Jeremy Kraybill
Austin, TX
Does this mean I should not be reference Static Resources in Visualforce templates? How else should I be posting Images into my templates? If I could post the image to our Public Website easier we would go that route - but I thought the whole point of Static resources/Documents was to have that data in Salesforce. I know documents have an "Externally Available Image" option - but I haven't seen a public/private option for Static Resources.

Message Edited by BrianWK on 12-30-2008 12:51 PM
Static resources are designed for use in VisualForce templates, they are just not publicly accessible (until you are using Sites). So you can use them pretty much in any VF page other than email templates.

Jeremy Kraybill
Austin, TX

Anybody ever find a way to make this work?


I noticed that this link says you can't do it, but it was mentioned here that maybe you could with sites.

Abhishek Kumar 407Abhishek Kumar 407
I have used Document image inside salesforce which showed image in sf platform and I sent the email preview to my mailId, and I can see image there.

Just follow these steps:-
1). Upload image in Document folder.
2). Tick mark the checkbox stating "externally available"
3). Save the image.
4). After page will refresh, you will see the image preview inside document header with image's label. Right click on image and copy the address.
5). Now your image url looks like this :-
6). Now you can use this url anywhere. It will be displayed inside sf platform and outside as well.

Hope it answered your query!

Abhishek Kumar