There is no setting for the default visibility of Files shared on records, but having a community changes the visibility options:
Examples:
Take that Account Id and run the below query from the workbench. Use the account Id for LinkedEntityId in the WHERE condition.
SELECT ContentDocumentId, LinkedEntityId, Visibility, ShareType
FROM ContentDocumentLink
WHERE LinkedEntityId='0013D00000QEgMaQAL'
Output:
| ContentDocumentId | LinkedEntityId | Visibility | ShareType |
| 0693D0000005ixzQAA | 0013D00000QEgMaQAL | AllUsers | V |
Output:
| ContentDocumentId | LinkedEntityId | Visibility | ShareType |
| 0693D0000005ixzQAA | 0013D00000QEgMaQAL | AllUsers | V |
| 0693D0000005jGDQAY | 0013D00000QEgMaQAL | InternalUsers | V |
Additional Information:
See our ContentDocumentLink documentation for more information about the different visibility types and their definitions.
for(ContentDocumentLink cont : Trigger.new)
{
cont.Visibility = 'AllUsers';
}
See also
Community User cannot view 'Files' migrated from 'Attachments'
Change the default visibility of Files shared on records using Data Loader
Set File Sharing to Inherit Record Permissions
000384243

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.