Taming a Dropbox link

Getting a link to share a file from Dropbox is easy. However, there are sometimes unwanted side effects. For example, unless you have a Dropbox Business account, you can’t universally disable the feature that hides the comment box when someone clicks your link. This makes me crazy—the last thing I want to deal with is unwanted/unneeded comments on a simple file share.)

You also might want to control what happens when someone clicks your link—perhaps you prefer them, for example, to listen to a music file from within their browser (as opposed to downloading it).

These three things—comments, play/view in browser, or download file—can be controlled by how the Dropbox link is crafted. Enter “query strings.” A query string is part of a URL that assigns a particular value to a parameter that is passed to the site. Of course, functionality has to be built into a website to take the passed parameter and do something constructive with it. Dropbox’s API (application programming interface) determines what query strings are made available to use.

Let’s go in order:

  • To remove the comment section entirely, add ?raw=1 to the end of the Dropbox link. (However, ?raw=1 also forces a file to open in the browser. That same behavior can be controlled by ?dl=0 (see the next paragraph), but the side-effect is that the comment section will appear.)
  • To tell the browser to play/view a link within the browser, add ?dl=0 to the end of the Dropbox link. (dl is short for download) The drawback to this method is that, if not combined with ?raw=1 the comment section will appear.
  • To tell the browser to download the file, add ?dl=1 to the end of the Dropbox link. However, if the browser used has been setup to play/show files from within the program, it may override the download directive, forcing you to manually initiate the download.

Want to combine the first with one of the other two? Add a semicolon (;) between them, no spaces, and only use the question mark (?) once—before the first query string.

A sample link might look similar to this: https://www.dropbox.com/z/zZzZzZ/Test%20File.mp3?dl=0;raw=1
◼︎