Experience Cloud (community) users cannot see files linked to records via the ContentDocumentLink object unless the "Customer Access" setting is explicitly enabled on each file. By default, Salesforce sets the Visibility field on ContentDocumentLink to "InternalUsers" when a file is uploaded to a record. This makes the file invisible to Experience Cloud users even if those users have access to the parent record.
There is currently no out-of-the-box setting to enable Customer Access by default for new or existing files. This is a known platform limitation. The following restrictions apply:
This is a known limitation confirmed in the following Salesforce IdeaExchange posts:Clarification: Related IdeaExchange Post:
Option to set Customer Access on Files by Default
This link leads to a Salesforce IdeaExchange post, where customers have requested Salesforce to add the ability to set Customer Access = ON by default when files are shared to a record.
This is an IdeaExchange post, not an active feature.
To automatically set file visibility to AllUsers for all new files linked to records, create an Apex trigger on the ContentDocumentLink object that fires on before insert. The trigger should loop over each ContentDocumentLink record in Trigger.new and set the Visibility field to 'AllUsers'. This makes the file visible to all users — both internal and Experience Cloud (community) users — who have access to the linked record.
What this does: When a user uploads a file to any Salesforce record, the before insert trigger intercepts the ContentDocumentLink record before it is saved and overrides the default Visibility value from 'InternalUsers' to 'AllUsers'. No manual toggling of the Customer Access setting is required.
Note: This trigger applies to all new file uploads going forward. To update existing files, a batch Apex job or Data Loader update on existing ContentDocumentLink records with Visibility = 'InternalUsers' is required separately.
Apex Trigger example:
trigger SetFileVisibility on ContentDocumentLink (before insert) {
for (ContentDocumentLink cdl : Trigger.new) {
cdl.Visibility = 'AllUsers'; // Makes file visible to internal and external (community) users with access to the record
}
}
005101347

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.