Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
peytonshc
9 years agoExplorer | Level 3
Unable to download file to a desired path via files_download_to_file using the python api
I am using the files_download_to_file function to try and download a file from my dropbox to a specific location. As parameters I am giving it '/home/user/Desktop' and it is saying IOError: [Errno 2...
peytonshc
9 years agoExplorer | Level 3
Here is an example:
with open('Resume BigRed.pdf', "wb") as f:
try:
metadata = dbx.files_download_to_file('/home/ubuntu-mate/Desktop/test/Resume BigRed.pdf', "/Resume BigRed.pdf")
f.write(metadata)
except TypeError:
print("Ignoring TypeError")
I'm using the try to avoid the TypeError for entering metadata but it runs.
Greg-DB
Dropbox Community Moderator
9 years agoIn this sample, the `files_download_to_file` method will save the file to '/home/ubuntu-mate/Desktop/test/Resume BigRed.pdf'.
Separately, you're calling `open` and `f.write(metadata)`, which will save the file metadata (not the file content) to a file 'Resume BigRed.pdf' in the current directory. If you don't want that file, remove your `open` and `write` calls.
Separately, you're calling `open` and `f.write(metadata)`, which will save the file metadata (not the file content) to a file 'Resume BigRed.pdf' in the current directory. If you don't want that file, remove your `open` and `write` calls.
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!