A practical field guide from Automation Ace.
How to Get a Dropbox File Direct Download Link in Zapier
When you share a file from Dropbox, the URL you get is a preview link — it opens a Dropbox web page showing the file with options to view, download, or comment. That preview URL is not useful when you need a link that directly downloads the file: for embedding in an email as a download button, passing to an API that expects a raw file URL, or using in a webhook payload where the recipient needs to fetch the file programmatically. Converting a Dropbox share link to a direct download link is a simple URL string transformation that can be done in Zapier with Formatter by Zapier or a Code step.
How Dropbox Direct Download Links Work
Dropbox share links use a predictable URL format. The shared link URL looks like one of these patterns:
https://www.dropbox.com/s/abc123xyz/filename.pdf?dl=0https://www.dropbox.com/scl/fi/abc123xyz/filename.pdf?rlkey=...&dl=0
The key parameter is dl=0 at the end. When this parameter is changed to dl=1, Dropbox serves the file as a direct download rather than opening the preview page. That is the entire transformation — change dl=0 to dl=1.
Additionally, www.dropbox.com can be replaced with dl.dropboxusercontent.com for the direct content URL, though the dl=1 approach on the standard domain is simpler and more reliable for most use cases.
Method A: Formatter by Zapier — Replace Text
The simplest approach uses Formatter by Zapier's text replacement to swap the parameter value.
- Add a Formatter by Zapier action step after the step that produces the Dropbox URL.
- Select Text as the transform type.
- Choose Replace as the action.
- In the Input field, map the Dropbox share URL from the previous step.
- Set Find to:
dl=0 - Set Replace With to:
dl=1
The output is the direct download URL. Map this output field into any downstream step that needs the link.
This works for the standard dl=0 case. If the URL does not include a dl parameter at all (some older Dropbox link formats), use the append approach in Method B.
Method B: Code Step — Handle All Dropbox URL Formats
For a more robust transformation that handles URLs with and without the dl parameter, and optionally converts the domain to dl.dropboxusercontent.com, use a Code step:
const url = inputData.dropbox_url;
let directUrl;
if (url.includes('dl.dropboxusercontent.com')) {
// Already a direct content URL — ensure dl=1 is set
directUrl = url.replace(/([?&]dl=)\d/, '$11');
} else if (url.includes('?')) {
// Has query params — replace or add dl=1
if (url.includes('dl=')) {
directUrl = url.replace(/dl=\d/, 'dl=1');
} else {
directUrl = url + '&dl=1';
}
} else {
// No query string — add dl=1
directUrl = url + '?dl=1';
}
output = { direct_download_url: directUrl };
Pass the Dropbox URL as dropbox_url in the Code step's input data. The output field direct_download_url is the usable direct download link.
Getting the Dropbox Share URL in a Zap
The Dropbox URL you are transforming must come from somewhere in the Zap. Common sources:
- Dropbox trigger — New File in Folder: The trigger output includes the file's shared link URL. If it does not appear automatically, add a Dropbox action step "Create or List Shared Link" to generate one for the new file.
- Dropbox action — Upload File: After uploading a file to Dropbox from a previous step (e.g., a generated PDF or a file from another service), use "Create or List Shared Link" to get the shareable URL, then convert it.
- A stored URL from a database: If Dropbox URLs are stored in an Airtable field or Google Sheet cell, they can be fetched by a search step and then converted.
Using the Direct Download URL
Once converted, the direct download URL can be used in:
- Email actions: Include it as an href in an HTML email template — clicking the link immediately downloads the file instead of redirecting to a Dropbox preview page
- API calls: Pass it as a
file_urlparameter to services that accept a remote file URL (document signing platforms, image processing APIs, cloud storage migrations) - Slack messages: Share the direct URL in a channel message — Slack users clicking it download the file directly
- Airtable attachment fields: Some Airtable API operations accept a URL to fetch and attach — a direct download URL works where a preview URL does not
Dropbox Link Expiry Considerations
Dropbox shared links created with default sharing settings do not expire — they remain active until the file is moved, deleted, or the link is removed in Dropbox settings. However, links shared from Dropbox Business accounts with link expiry policies set may expire. If you are building a workflow that stores the converted URL for long-term use, verify the sharing policy of the Dropbox account being used.
Thedl=0todl=1swap is one of the simplest and most useful URL transformations in file automation workflows. It requires no API call, no authentication, and no complex logic — just a string replace. Formatter by Zapier handles it in a single step, making it easy to add to any Zap that passes Dropbox files downstream.
For similar file link transformation patterns in Google Drive, see Google Drive file link formats and how to use them. For help building a Dropbox-connected automation workflow, talk to Automation Ace.
Disclaimer: This article may include links to apps, products, or services. Some links may be affiliate links, which means Automation Ace may earn a commission at no extra cost to you.