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 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.