4

I have a community that we set up to point to a VF page. One of the things we want to do is to allow guest users to download Chatter files (ContentVersion or whichever one works).

I am able to present the guest user with a download link that looks like this: [clipped]/sfc/servlet.shepherd/version/download/[content-version-Id].

For logged in users that works and the file downloads, but for a guest user I'm getting top.location='https://[clipped].cs88.force.com/ex/errorduringprocessing.jsp'

2 Answers 2

0

I have faced the simillar issue. The link was used by guest users in a public site. ContentDocument was successfully downloaded in sandbox, but the error appeared in production.

In my case the error appeared due to a wrong sharing rule in production: accounts became hidden from the guest users, while they need to have access to the records, associated with the document(accounts in my case) in order to download it. After we'd fixed the rule, the error has dissapeared.

0

To expose a file publicly, you can simply create a record on ContentDistribution object with a link to the respective ContentVersion Id.

On ContentDistribution there are two fields- DistributionPublicUrl and ContentDownloadUrl

DistributionPublicUrl contains the URL of the shared file that can be previewed within a container.

ContentDownloadUrl contains the URL of the shared file that lets you directly download the file. And you can use this URL in img tag as source(src) to display the file.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .