You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.
Forum Discussion
daniilkurlovich
7 years agoNew member | Level 2
Image brokes when I upload files with http
Hi, i got a problem with upload images in dropbox. Check my code
Other files are transmitted and i can read after upload in dropbox.
But in images files written 'This file is not available for preview.'
- Greg-DBDropbox Staff
[Cross-linking for reference: https://stackoverflow.com/questions/53488348/image-brokes-when-i-upload-files-with-http ]
You're using the "files" parameter in the Python requests library "post" method, which seems to be for "multipart encoding upload". The Dropbox API /2/files/upload endpoint does not use multipart encoding upload, however, and instead just expects the raw file content to be sent in the request body (to match the "Content-Type: application/octet-stream").
Update your code to use the "data" parameter to send the file data in the request body instead.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,910 PostsLatest Activity: 2 days agoIf 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 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!