Last active
December 18, 2018 16:31
-
-
Save helinwang/d7894d625506e91ca43b318020e7525a to your computer and use it in GitHub Desktop.
Upload large file to dropbox using Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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