Created
September 7, 2019 20:06
-
-
Save abhay-kum/4468431e2747d8ed87a0e2e3475f0bb9 to your computer and use it in GitHub Desktop.
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 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