5

We're querying ContentDocumentLink for a list of documents related to a specific object record that the user has access to, and attempting to create a link for the community user to download that document. We're finding the ContentDocument ID in ContentDocumentLink.LatestPublishedVersion.Id. The LEX link of /sfc/servlet.shepherd/version/download/{ID} works fine from the Org domain, but I am not finding an equivalent for the Community domain. The error I receive is that the "community is down for maintenance". I've tried a number of variations and mixtures of this and /lightning/r/ContentDocument/{ID}/view. Is this something that can be done in Lightning Communities?

We are building this page using Skuid (basically html in this particular case), so we are not able to use an Aura or LWC solution.

2

The download link on the file previewer in a community generates a link of this format.

It should work fine for your scenario with the exception of not being a best practice to hardcode it like this.

/sfc/servlet.shepherd/document/download/{id}?operationContext=S1
  • No dice. I still get the "Down for Maintenance" error page. – SuperJer May 2 at 19:49
  • @SuperJer Can you navigate to the file viewer in the community and see what the download links look like in your specific environment? /s/contentdocument/069{theRestOfTheContentId} – Mark Pond May 2 at 21:27
  • Hmm. I get an "Invalid Page" when navigating there in the runtime, and a "We can't load this page because it's missing some underlying data" error in the communities builder. – SuperJer May 3 at 19:59
1

This one is working correctly in our community : /sfc/servlet.shepherd/document/download/{ContentDocumentId}?operationContext=S1

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.