cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
We love to hear how every person gets the most from Dropbox, and it seems everyone has a slightly different use for it - tell us yours here!

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Can't download file using files_download_to_file

Can't download file using files_download_to_file

harrycallard
New member | Level 2

This is really starting to be a pain.

I can't seem to get the correct directory of my file. I'm trying to download a file from my DB using the files_download_to_file() function.

 

I'm trying to run

dbx.files_download_to_file("F:/Programming/Visual Studio/Programming/Python/dbdltest/Database.xlsx""/Stock_List/Database.xlsx")

 

I simply get back: DownloadError('path', LookupError('not_found', None)))

 

What is the actual issue here? I've tried using files_list_folder("") and files_list_folder("/Stock_List") too, to no avail.

 

When i use files_list_folder("") I get nothing, but when i print(files_list_folder(")) i get a load of garbage jargon.

 

Surely there is something simple im missing here and it isn't this finnicky to just simply download a file on to my local drive...

1 Reply 1

Re: Can't download file using files_download_to_file

kylea
Dropboxer

This is the Python SDK, correct?

 

calling print(dbx.files_list_folder("")) will show the full ListFolderResult object. 

 

To iterate over the results and print just the path, you'll want something like this:

 

res = dbx.files_list_folder("")
    for entry in res.entries:
        print(entry.path_lower)

 

That will return valid paths that you can use with the files_download_to_file call.

Who's talking

Top contributors to this post

  • User avatar
    kylea Dropboxer
What do Dropbox user levels mean?
Need more support?