cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Are you new to Dropbox? Our Newcomers group is the perfect place to learn the basics, find out more 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: 

File transfer API

File transfer API

hrh747
Helpful | Level 5
Go to solution

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

1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution

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.)

View solution in original post

2 Replies 2

Greg-DB
Dropbox Staff
Go to solution

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.)

hrh747
Helpful | Level 5
Go to solution

Thanks for your confirmation.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    hrh747 Helpful | Level 5
  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?