Sometimes I want to share a large file on my site without tying up bandwidth. If I don’t intend for the file to be downloaded often, I can offload the work to Dropbox and use PHP or htaccess to share a convenient URL.
$file_url = 'https://dl.dropboxusercontent.com/s/05tgracr475xvke/some_large_psd_file.zip'
// Redirect the request to DropBox
header( 'Location: ' . $file_url);
RewriteRule ^project/psdfile\.psd "https://dl.dropboxusercontent.com/s/05tgracr475xvke/some_large_psd_file.zip" [R=302,L]
You can get the direct download link for a Dropbox file like so
1) Sign in and upload a file
Here I will share a hard-to-find firmware file for a Japanese Buffalo WZR-HP-G450H router to make it accept US firmware (and not be intentionally crippled anymore!). Now I can use
wget to retrieve it.
2) Share the file
Hover or right click on the link and click “share”.
3) Create a share link
Click on “Create a link” and then copy the new link.
4) Modify the URL
dl.dropboxusercontent.com, and remove the trailing