Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
emre
9 years agoExplorer | Level 4
php file download
Hello, I am trying to download a file with PHP, but I am having trouble with this part of the code. I need an example in this regard
$url = "https://content.dropboxapi.com/2/files/download";
$s...
emre
9 years agoExplorer | Level 4
Attempting to open the file in the browser
How to access direct download link ?
Greg-DB
Dropbox Community Moderator
9 years agoIs that the output you're getting from the PHP code you shared earlier? If so, that is likely just the raw file data, which the browser is trying to display as text. The /2/files/download endpoint does return the raw file data, so you can do with it whatever you need to. E.g., save it to a file, etc.
If you want a link to the file instead, you can use /2/files/get_temporary_link:
https://www.dropbox.com/developers/documentation/http/documentation#files-get_temporary_link
If you want a link to the file instead, you can use /2/files/get_temporary_link:
https://www.dropbox.com/developers/documentation/http/documentation#files-get_temporary_link
- emre9 years agoExplorer | Level 4
Thank you so much
That's exactly what I'm looking for :) - emre9 years agoExplorer | Level 4
Merhaba Greg, ne yazık ki (# files-get temporary link) işe yaramadı
I want to make a download button like picture
- Greg-DB9 years ago
Dropbox Community Moderator
The screenshot you shared shows you trying the /2/files/download endpoint. You can use that to directly return files contents if you'd like.
We discussed using /2/files/get_temporary_link though. That would give you a direct URL for the file contents. This is working correctly as far as I can tell.
In either case, how you use that response is up to you, and exactly how you implement it will depend on the specifics of your app.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!