Here's my code:

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

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 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 at 13:59
up vote 0 down vote accepted

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.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.