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
Prasan6Prasan6 

Salesforce files for Guest community user

Hi, 

Can we view Salesforce files logged in as Community guest user? I have a file related list under case I can view File related list when logged in as community user however prior to log in (as a guest user) I can see case but not file related list. Are files visible for a guest user? If yes how can I enable? 

Thanks, 
 
Raj VakatiRaj Vakati
Please refer this link 
Content is not available with Customer Community licenses. 


https://help.salesforce.com/articleView?id=users_license_types_communities.htm&type=0
https://success.salesforce.com/answers?id=9063A000000l4mDQAQ
Prasan6Prasan6
Hi Raj, 

Thanks for your reply. We are using Customer community plus license and content is available for a logged in community user, its just the guest user who cannot see. 
Nguyen Tran 6Nguyen Tran 6
Hi Prasan, have you had any luck with this? We are running into same issue.
Joshua Carritt-Baker 2Joshua Carritt-Baker 2
Just a bump. Would be v useful for guests to see Files related list in public Groups
Bishwambhar Sen 16Bishwambhar Sen 16
Not sure if you are still looking for solutions to this problem but I had the same issue and I figured it out. Because of current permission restrictions you cant directly allow a guest user to access Content Document or files. That being said. You could always display the content using dataURI by rendering the binary value of the file. You need to encode it in base64 and then use dataURI to display it on the client side. I tried it for images and it worked for me. One caveat to this approach is, for bigger file sizes the download can freeze sandbox environment pages and in production it wont freeze but degrade the performance a bit. I wish Salesforce would allow sharing related files if the record itself is accessible to guest users. 
James Johnson 110James Johnson 110
While it's not possible to list files in a library it's possible to show the content in a page, there is no need to base64 the file:
User-added image

- You must establish the guest user using the sites URL.
- You must share the file with the community
User-added image
User-added image

- You must tick the box to allow guest users to access files in community.
User-added image




The take the community URL and append the download details:
https://cms244.my.localhost.sfdcdev.site.com:7443/csp001

File download details:
/sfc/servlet.shepherd/document/download/069xx0000004CDsAAM

Full URL will look like this:
https://cms244.my.localhost.sfdcdev.site.com:7443/csp001/sfc/servlet.shepherd/document/download/069xx0000004CDsAAM

 You can also create an asset file to make the file public too.