We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here.

Forum Discussion

fapb88ve's avatar
fapb88ve
Explorer | Level 4
8 years ago

Downloading a file from using the Python Dropbox API

Hello,   Sorry for the basic question. I'm updating the code I had for the V1 Python API and I'm having a trouble with the download function. Originally I used the following: f, metadata = clie...
  • Greg-DB's avatar
    8 years ago

    The files_download method is the closest to what you were using. The files_download_to_file method takes an extra parameter for saving the file locally for you.

     

    So either of these should be equivalent to your old code:

     

    metadata, f = dbx.files_download('/'+ j)
    out = open(j, 'wb')
    out.write(f.content)
    out.close()

     

    or just

     

    dbx.files_download_to_file(j, '/'+ j)