We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
yekootmada
6 years agoNew member | Level 2
Python SDK File Uploading - Working with the Response
Hi there, I am new to interfacing with the Dropbox API and am using Python 3.6 I am uploading large files to my account using the following function called dropboxupload (not my own) . I simply ca...
Greg-DB
Dropbox Community Moderator
6 years ago[Cross-linking for reference: https://stackoverflow.com/questions/60302382/python-dropbox-upload-working-with-the-response ]
The 'dropbox.files.FileMetadata' is just the class, and not an instance containing the information for this uploaded file. That is, you'll want to do something like this (or return it and use it later like Здравко said):
file_metadata = dbx.files_upload_session_finish(f.read(CHUNK_SIZE), cursor, commit)
print("This is the id of the uploaded file:")
print(file_metadata.id)yekootmada
6 years agoNew member | Level 2
great thanks Greg.
Still cant find where that should go in, everytime I try its giving me inconsistent use of tabs, spaces and indentations error.
GRRR
- Здравко6 years agoLegendary | Level 20
Take a look here: https://www.python.org/about/gettingstarted/
- Greg-DB6 years ago
Dropbox Community Moderator
The files_upload_session_finish method returns the FileMetadata instance you want, so you should update your use of files_upload_session_finish. In your original code, you're just printing it out, but you can instead save it to a variable and use it there, or return it from your dropboxupload method and use it later.
- yekootmada6 years agoNew member | Level 2
Cracked it.
Thanks all!
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.
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!