Here's my code:

<lightning:layoutItem padding="around-small">
    <lightning:fileCard fileId="069XXXXXXXXXXXX" description="logo"/>

I'm using (for now) a hardcoded Id of a ContentDocument that I know exists, but all I get is a box with No preview available in it.
The lightning component sits on the Community Builder page on a site.
The file itself is visible to Your Company. The person trying to view this image is logged in as a community user.
There's obviously some configuration I'm missing, but dammit Jim, I'm a developer, not an administrator.
The ContentDocument I'm trying to view here has a ContentDocumentLink with Visibility=AllUsers and LinkedEntityId=00DXXXXXXXXXXXX.
Doesn't that mean that the file is shared with the entire org? All of the users in the org? Including community users?

  • [The person trying to view this image is logged in as a community user] -- Does the Community User have the access to the File? – Jayant Das Dec 4 '18 at 13:55
  • @JayantDas from what I can tell, yes. But I'm obviously missing something, I just don't know what. – AvailableName Dec 4 '18 at 13:59

Well, it turns out that this is some kind of "feature" of Salesforce.
Any file created before a community exists cannot be shared with the community. That's just the way it is. And my file is older than the community.
However, any file that is created after the community exists and is shared with the entire org (ContentDocumentLink with Visibility=AllUsers and LinkedEntityId=00DXXXXXXXXXXXX) will be visible to community users.
So I uploaded a new file and tried that in the lightning:fileCard and that worked.
Knowledge Article.


Is this problem occur due to User License? As the Customer Community Login License don't allows for Content availability for files. Refer the document: https://help.salesforce.com/articleView?id=users_license_types_communities.htm&type=5

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.