You need to sign in to do that
Don't have an account?
dai tran 6
Why can't display image on public site from Static Resouce?
This my code display image:
If i login to salesforce and run it display ok.
View html of control:
If i not login to salesforce and run, it can't display image.
View html of control:
i had set Cache Control of resource [ProductImage] is Public
Why can't display image on public site from Static Resouce?
<apex:image width="100p" height="100p" value="{!URLFOR($Resource.ProductImage, 'ProductImage/' & row.ImageName__c)}"></apex:image>
If i login to salesforce and run it display ok.
View html of control:
<img src="/resource/1528944622000/ProductImage/ProductImage/1.jpg" height="100p" width="100p">
If i not login to salesforce and run, it can't display image.
View html of control:
<img src="/demo1/resource/1528944622000/ProductImage/ProductImage/" height="100p" width="100p">
i had set Cache Control of resource [ProductImage] is Public
Why can't display image on public site from Static Resouce?
Mark as best answer, If it resloves !!
I ensured the following things, and was able to make an .xls file attached to a document downloadable on a sites page:
1. In the Sites Profile ("public access settings"), enable Read access to Documents (You indicate that this is already the case)
2. Edit the folder in which the document is stored, and ensure that the Sites profile has access to the folder. To do this, I went to Admin setup ---> Manage Users ---> Public Groups and created a group consisting of ONLY the User defined by my Sites profile. You can then add this "group" to the permissions on the folder.
Use <apex:outputLink> and in the value put "/servlet/servlet.FileDownload?file=(your docs ID here)"
Hope this helps.
check these link
https://developer.salesforce.com/forums?id=906F000000099UoIAI
Mark as resloved if it helps :) :)
Thanks,
Bhanu Prakash
visit ForceLearn.com (https://www.forcelearn.com)
This is my query:
select name,price__c,imagename__c,Product_Code__c from MyProduct__c
I try display value of them:
<apex:column value="{!a.ImageName__c}"/>
<apex:column value="{!a.Product_Code__c}"/>
<apex:column value="{!a.Name}"/>
<apex:column value="{!a.Price__c}"/>
2 columns: Product_Code__c, Name display ok.
2 column: ImageName__c , Price__c can't display.
if ImageName__c , Price__c can't display these both are image files issue with your code,
check rightclick on output page and click on inspect check whether image space is rendering or not in UI level.
If yes please check below link
https://developer.salesforce.com/forums/?id=906F0000000fz6CIAQ
Mark as resloved if it helps :) :)
Thanks,
Bhanu Prakash
visit ForceLearn.com (https://www.forcelearn.com)
If run by link publick, only 2 column: ImageName__c , Price__c can't display.
If debug on Browers and change src="/demo1/resource/1528944622000/ProductImage/ProductImage/1.jpg" , image display ok.
My problem is why can't get value of ImageName__c and Price__c, if run by public link.
Controller:
home page:
Result Click Preview:
Result run on public site: