Skip to content

Instantly share code, notes, and snippets.

@helinwang
Last active December 18, 2018 16:31
Show Gist options
  • Save helinwang/d7894d625506e91ca43b318020e7525a to your computer and use it in GitHub Desktop.
Save helinwang/d7894d625506e91ca43b318020e7525a to your computer and use it in GitHub Desktop.
Upload large file to dropbox using Python
import sys
import dropbox
path = sys.argv[1]
dbx = dropbox.Dropbox(AUTH_TOKEN, timeout=6000) # set the timeout best for you
with open(path, 'rb') as f:
data = f.read()
dbx.files_upload(
data, DROPBOX_FOLDER_NAME, dropbox.files.WriteMode.overwrite,
mute=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment