

If you find a bug, please see CONTRIBUTING.md for information on how to report it.

# be sure and get time zone aware time in UTC time so that it saves with correct time Print("' does not exist!".format(src_file_path))įile_mtimestamp = os.path.getmtime(src_file_path)

# TODO: Check for successful cursor creationįile_chunk = file_to_upload.read(CHUNK_SIZE) Session_cursor = (session_id=session_start_ssion_id, offset=file_to_upload.tell()) Session_start_result = dbx.files_upload_session_start(b"",) With open(file_path, mode='rb') as file_to_upload: # Destinatoin TODO: Need to figure out mode and autorename parameterĬommit_info = (path="/Uploaded_from_SDK/20170328_195058.jpg") See: # TODO: Use with, exception handling, del Instead, create an upload session with :meth: files_upload_session_start. Text = 'Hello, World!' # For example just set a string and encode it as bytesĭbx.files_upload(text.encode('utf-8'), '/hello/hello_world.txt') Uploading a file: # open a dropbox with an access tokenĭbx = dropbox.Dropbox('YOUR_ACCESS_TOKEN')įor entry in dbx.files_list_folder('').entries: May want to look at this example application: Backup and Restore Installing and importing the api pip3 install dropbox You can revoke the token as follows: dbx = dropbox.Dropbox('access token') If you think you may have accidentally leaked it out or just want to be safe. Note that if you create a temporary access code to use during development of the app, it is supposed to be kept secret. Notes on what I've learned about the Python Dropbox API
