I'm utilizing the following URL to load an image stored as a ContentVersion
file in an IMG
tag. It loads correctly in SF but not on the force.com public site:
/sfc/servlet.shepherd/version/renditionDownload?rendition=THUMB720BY480&versionId=06815000002QhYPAA0
I've tried loading the full URL path in the browser as well https://SITENAME.secure.force.com/sfc/servlet.shepherd/version/renditionDownload?rendition=THUMB720BY480&versionId=06815000002QhYPAA0
Any suggestions?
UPDATE:
I created the following sample VF page to exclude any other possibilities, the image loads correctly in SF, but when I try at the site URL it fails https://SITENAME.secure.force.com/apex/testcontent
. Seems like its accessible but not rendering for some reason.
VF PAGE
<<apex:page controller="ctl_testContent" >
<!-- attempt 1 -->
<img src="/sfc/servlet.shepherd/version/renditionDownload?rendition=THUMB720BY480&versionId=06815000002QhYPAA0"/>
<!-- test accessible -->
{!cv.id}<br/>
{!cv.versionData}
</apex:page>
CONTROLLER:
public class Ctl_Testcontent {
public ContentVersion cv {get;set;}
public ctl_testContent() {
cv = [SELECT Id,VersionData FROM ContentVersion WHERE id='06815000002QhYPAA0'];
}
}
OUTPUT:
[broken image]
06815000002QhYPAA0
core.filemanager.FileBlobValue@4bec7a37
UPDATE 2:
As an update to this I noticed documents are very easy to make public via /servlet/servlet.ImageServer?id={DOCUMENT_ID}&oid={ORG_ID}
. It'd be nice if there was something similar for SF Files. At this point I may have to clone SF Files to be Documents simply for this functionality. I have gotten SF Files to render in public sites but its a headache of creating a group, adding the public sites user, creating a library, adding a file to the library etc...not going to work for my use case where its automated.
/sfc/servlet.shepherd/servlet.shepherd/version/download/06815000002QhYPAA0