Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
pyraxic
8 years agoHelpful | Level 6
Error downloading files from dropbox API
I am trying to download files from dropbox but keep hitting the ValidationError.
for dfiles in flist:
dbx.files_download_to_file('/Users/fela/Downloads/dropbox', dfiles, rev=None)
Her...
- 8 years ago
You do need to use the full path when specifying the file you want to download. Using files_list_folder and files_list_folder_continue will give you every entry, and you can get the full path from the returned (File)Metadata.path_lower. (I.e., use `entry.path_lower` instead of `'/'+entry.name`.)
pyraxic
8 years agoHelpful | Level 6
Here is my code.
dbx = dropbox.Dropbox(oauth_result.access_token)
result = dbx.files_list_folder("", recursive=True)
flist = []
def process_entries(entries):
for entry in entries:
if isinstance(entry, dropbox.files.FileMetadata):
flist.append(entry.name)
dbx.files_download_to_file('/Users/fela/Downloads/dropbox/'+entry.name, '/'+entry.name)
It gives me an error:
ApiError('9102ee3554ff1ef69453c208accc6568', DownloadError('path', LookupError('not_found', None)))
Unless I use "/Camera". As you can see that I am using "" with recursive=True to go through the entire dropbox and list files. I am not able to download it unless I specify the folder name. How can I get the folder structure and files under them so I can download files from the root folder and all the subfolders under them?
Greg-DB
Dropbox Community Moderator
8 years agoYou do need to use the full path when specifying the file you want to download. Using files_list_folder and files_list_folder_continue will give you every entry, and you can get the full path from the returned (File)Metadata.path_lower. (I.e., use `entry.path_lower` instead of `'/'+entry.name`.)
- pyraxic8 years agoHelpful | Level 6
Awesome! That works. Thank you
- rhernandez83058 years agoHelpful | Level 6
this example (Download file), do you have in github or similar plataform?
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!