Skip to content

Commit 4e21479

Browse files
Eric Zhangbraincore
authored andcommitted
Pass file data instead of file handle to upload
1 parent 3bc4b9b commit 4e21479

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

example/back-up-and-restore/backup-and-restore-example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def backup():
2323
# are changed on upload
2424
print("Uploading " + LOCALFILE + " to Dropbox as " + BACKUPPATH + "...")
2525
try:
26-
dbx.files_upload(f, BACKUPPATH, mode=WriteMode('overwrite'))
26+
dbx.files_upload(f.read(), BACKUPPATH, mode=WriteMode('overwrite'))
2727
except ApiError as err:
2828
# This checks for the specific error where a user doesn't have
2929
# enough Dropbox space quota to upload this file

0 commit comments

Comments
 (0)