Your workflow is unique 👨💻 - tell us how you use Dropbox here.
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.'
1 Reply
- Greg-DB7 years ago
Dropbox Community Moderator
[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 and Feedback
Get help with the Dropbox API from fellow developers and experts.
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!