Is there a particular url I can put into a custom link or button that will link to a chatter file, that when clicked will download the most recent version?

I know I can use the download url to get a specific version, but that involves an admin updating the button everytime the file version changes.


The core URL for the Chatter file should always reference the current version. But this only works if the users remember to use the "Upload New Version" option. I find a lot of people just do a new upload, which duplicates the file.

So, the custom button or Link could be literally just the file ID. For example:


The only reason to use an explicit version is when you want something other than the current version of the doc. Replace the hard coded value for an ID variable and you're off and running.

| improve this answer | |
  • But that doesn't address the auto download part..... – ChrisN Jan 23 '13 at 13:41

After inspecting the standard download links for chatter files, I came up with a apex function which returned the file download links. You can try creating the link for download in the following format -

String FileDownloadUrl = URL.getSalesforceBaseUrl().toExternalForm()+ '/sfc/servlet.shepherd/version/download/' + FeedItem.RelatedRecordId + '?asPdf=false&operationContext=CHATTER';
| improve this answer | |

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.