We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
keano16
6 years agoNew member | Level 2
FileNotFoundError: [Errno 2] No such file or directory
Hi
I'm trying to download a dropbox link to a .xlsx file using the following script but am getting the error "FileNotFoundError: [Errno 2] No such file or directory: '/downloadfolder/subfolder'...
Greg-DB
Dropbox Community Moderator
6 years agoThe FileNotFoundError "No such file or directory" error here is referring to the location on your local filesystem, not in the remote Dropbox account. That is, the first parameter you supply to files_download_to_file (and sharing_get_shared_link_file_to_file as well) is the "Path on local machine to save file". (For comparison, files_list_folder lists the contents of the remote Dropbox account.)
So, you should update your 'download_path' value to point to an actual location on your local filesystem, or otherwise update your local filesystem to contain that path (e.g., put a "downloadfolder" folder in your filesystem root, etc.).
Also, note that the value you provide there should be the full path, including filename and extension, so you would probably want to make it something like '/downloadfolder/subfolder/file.xlsx', in addition to making sure the folder(s) exist locally.
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!