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

Forum Discussion

hrh747's avatar
hrh747
Helpful | Level 5
4 years ago

File transfer API

Hi,

I started to become familiar with the Dropbox API (Python). I am looking for the API that will transfer a file from my Windows 10 machine to my Dropbox account. Looking at this sample code on the Dropbox website to backup a file:

with open(LOCALFILE, 'rb') as f:
# We use WriteMode=overwrite to make sure that the settings in the file
# are changed on upload
print("Uploading " + LOCALFILE + " to Dropbox as " + BACKUPPATH + "...")
try:
dbx.files_upload(f.read(), BACKUPPATH, mode=WriteMode('overwrite'))
except ApiError as err:
...........

Is there another API that does file transfer, or this is how the file transfer is carried out by reading bytes from the source and writing to the destination (Just want to make sure I am not missing something)?

 

Thanks in advance

  • The files_upload method is the right way to use the Dropbox API via the Python SDK to send some file data to the Dropbox servers and save it as a file in the connected Dropbox account. (Note that it only supports files up to 150 MB in size; for larger files, use upload sessions.)

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff

    The files_upload method is the right way to use the Dropbox API via the Python SDK to send some file data to the Dropbox servers and save it as a file in the connected Dropbox account. (Note that it only supports files up to 150 MB in size; for larger files, use upload sessions.)

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

5,877 PostsLatest Activity: 12 months ago
325 Following

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 or Facebook.

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!