0

I have a site with a Visualforce page that requires access to ContentDocuments linked to an Opportunity. My problem is that i can only see, as a public guest user, content documents that are uploaded via APEX, but not via the standard button. Both records have the same permissions, and ContentDocumentLinks, but i can only access the one that was uploaded via apex. Is there any object that its created that gives this permission to the public guest user?

  • I know this is really old, but we are running into the same issue where if we upload a file through Apex, the file will be visible to a public guest user, but if the file is uploaded by a standard type user, the file is not accessible. Have you had any progress with finding a solution? – joe.stolz Aug 10 '18 at 14:58
1

I had a similar problem and believe I found a workaround. 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.