4

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?

1
  • 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. – Marco Galvão Sep 25 '17 at 14:43
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. 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.