Programmatically download content from share links

// By Steve Marx • Aug 20, 2013

A “Dropbox share link” is a link that’s intended to be sent out to another Dropbox user. The URL looks like this picture of me doing my job as a developer advocate:

A share link renders a preview of the content and offers options for the user to download or view the actual file. Share links can be created from the Dropbox UI (right-click and select “Share Dropbox Link”), or they can be created using the Core API.

If you have a share link for a file, you can download the file directly by using the ?raw=1 query parameter. For example, here again is me advocating:

If you just need to download the file once, it’s probably better to use a media link (“direct link” in Chooser terminology), but those links expire after four hours. Converting a share link is useful if you need a more “permanent” download link. I put “permanent” in scare quotes because a user can unshare the file at any time or simply move or delete it, at which point the link will stop working.

// Copy link