check whether file path exists (#5375)
This commit is contained in:
parent
833c24ebf6
commit
6d4d6cb8ca
1 changed files with 3 additions and 0 deletions
|
|
@ -155,6 +155,9 @@ def upload_file_to_dropbox(filename, folder, dropbox_client):
|
|||
file_size = os.path.getsize(encode(filename))
|
||||
mode = (dropbox.files.WriteMode.overwrite)
|
||||
|
||||
if not os.path.exists(filename):
|
||||
return
|
||||
|
||||
f = open(encode(filename), 'rb')
|
||||
path = "{0}/{1}".format(folder, os.path.basename(filename))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue