Skip to content

Instantly share code, notes, and snippets.

@abhay-kum
Created September 7, 2019 20:06
Show Gist options
  • Save abhay-kum/4468431e2747d8ed87a0e2e3475f0bb9 to your computer and use it in GitHub Desktop.
Save abhay-kum/4468431e2747d8ed87a0e2e3475f0bb9 to your computer and use it in GitHub Desktop.
import dropbox
from datetime import datetime
image_file_path = "data/medium_" + datetime.strftime(datetime.now(),'%Y_%m_%d') + ".png"
auth_token = <your dropbox token>
client = dropbox.Dropbox(auth_token)
print("user_information",client.users_get_current_account())
dropbox_file_name = "medium_" + datetime.strftime(datetime.now(),'%Y_%m_%d') + ".png"
f = open(image_file_path, 'rb')
response = client.files_upload(f.read(),'/images/'+dropbox_file_name, strict_conflict=False)
print(response)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment