Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
Hi!
I am trying to upload several files using the sessions and batch operators in the Dropbox SDK for Python. I'm trying to do something like this:
dbx = dropbox.Dropbox(<API KEY>) commit_info = [] for df in list_pandas_df: df_raw_str = df.to_csv(index=False) upload_session = dbx.upload_session_start(df_raw_str.encode()) commit_info.append(
dbx.files.CommitInfo(path=/path/to/db/folder.csv
) dbx.files_upload_finish_batch(commit_info)
But, I do not completely understand from the documentation, how should I pass the commit data and the session info to the "files_upload_session_finish_batch" function. The "files_upload_session_finish" function does allow a commit and a cursor, while the documentation states that the batch option only takes a list of commits.
My files are not particularly big, but they are numerous. That's why I'm not using any of the appending options. Should I use any cursor? I'm a little bit lost here 😞
@9krausec You'll need to poll files_upload_session_finish_batch_check to check on the result of the job. If you're not seeing anything uploaded, something must have failed, and the result from files_upload_session_finish_batch_check should tell you what it was.
@Greg - Thank you again. No errors were returned. Just states that status is "in-progress"
UploadSessionFinishBatchJobStatus('in_progress', None)
I'll tell ya what - You follow me through here to the end and I bet this is going to be an excellent reference for everyone else using Python. I'm actually surprised I wasn't able to find a working example in this forum, or in the examples on git.
In the meantime I'll keep at it.
@9krausec That indicates that the job is not done yet. You'll need to poll it until it's complete. That is, call it once every few seconds until it returns the result.
Hi there!
If you need more help you can view your support options (expected response time for a ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!