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.

2 Answers 2


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.

  • But that doesn't address the auto download part.....
    – ChrisN
    Jan 23, 2013 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';

You must log in to answer this question.

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