Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
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 21] Is a directory. I am not sure what is wrong with this and would greatly appreciate any support.
When calling files_download_to_file, the `download_path` parameter should be the full local path where you want to save the file, including the file name and extension. So, instead of '/home/user/Desktop', you should supply something like '/home/user/Desktop/filename.ext'.
I tried that before but got TypeError: 'FileMetadata' object is not iterable when I try and write it.
That works now but I am curious why when I run the program it download the files to the directed directory as well as the current directory. I would like this to just happen in the directed directory.
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.
Hi there!
If you need more help you can view your support options (expected response time for a ticket is 24 hours), or contact us on Twitter or Facebook.
For more info on available support options, see this article.
If you found the answer to your question, please 'like' the post to say thanks to the user!