function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Bob Poliquin 9Bob Poliquin 9 

Community users can not see files

I am trying to allow my community users to see attached files to a custom object. When i log in as the user I see the related list but no files are visible. 

I have made sure this setting is correct on the attached file.

User-added imageUser-added image
I'm not sure what else I need to do
VinayVinay (Salesforce Developers) 
Hi Bob,

Can you check visibility as Allusers on ContentDocumentLink for ContentDocument record.

Review below references:
https://salesforce.stackexchange.com/questions/239617/community-users-are-not-able-to-view-files
https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_contentdocumentlink.htm
https://help.salesforce.com/articleView?id=networks_files_on_records_visible_to_customers.htm&type=5

Hope above information was helpful.

Please mark as Best Answer so that it can help others in the future.

Thanks,
Vinay Kumar
AnudeepAnudeep (Salesforce Developers) 
Hi Bob, 

I recommend checking if the community user really has access to the file by running a SOQL query on UserRecordAccess
 
SELECT RecordId, HasReadAccess, HasTransferAccess, MaxAccessLevel FROM UserRecordAccess WHERE UserId = [Id of the community User] AND RecordId = [File ID]

If you get HasReadAccess as false, it means that there is no access. Try choosing Set by Record option instead of 'Viewer'

User-added image

If it doesn't help, I recommend reviewing File Visibility and Sharing in Communities documentation. If your community user is a guest user, to give guest users access to files in Communities, enable the community preference “Give access to public API requests on Chatter” in Experience Workspaces | Administration | Preferences.

You can engage support if you are still experiencing the issue

If you find this information helpful, please mark this answer as Best. It may help others in the community. Thank You!

Anudeep
Bob Poliquin 9Bob Poliquin 9
Thank you both for your help, 

Vinay,
where can I find check visibility as Allusers on ContentDocumentLink for ContentDocument record? I'm not sure where to find that in setup. I tried but can't seem to find it
VinayVinay (Salesforce Developers) 
Hi Bob,

You cannot check visibility through UI.

Run below query from dev console or workbench.
 
SELECT Id,ContentDocumentId, visibility FROM ContentDocumentLink where ContentDocumentId = '0696F00000HP2PZQA1'
Make sure you pass correct ContentDocumentId in above query.

Thanks,
Vinay Kumar
Bob Poliquin 9Bob Poliquin 9
I am getting this error when i run the query

User-added image
VinayVinay (Salesforce Developers) 
Looks like you might have missed select in query can you recheck your query?