I have a few documents uploaded to salesforce files and i have a force.com site with the public guest user profile. When i enter my force.com domain my visualforce page queries for ContentDocumentLinks, however when the guest user queries them only one of the three files shows up. The content document link have the same permissions, the content documents as well. I there any permission in any related object that i am missing?

  • Just found out, that if i upload the file to the contentDocuments via apex it shows, but not by the standard salesforce files upload button.
    – user37586
    Sep 25, 2017 at 14:43

1 Answer 1


I believe I found a workaround for this issue. Creating a before insert trigger on ContentVersion that sets the Origin field to C, along with a before insert trigger on ContentDocumentLink that sets Visibility to AllUsers, allowed the public force.com site guest user to access the Salesforce File which was uploaded by the out of the box UI. So records started being returned when querying ContentDocumentLink and ContentVersion as the site user after uploading with those trigger changes in place. 

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .