We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here.
Forum Discussion
Mayil
7 years agoExplorer | Level 3
Expecting one of "application/octet-stream", "text/plain; charset=dropbox-cors-hack".
I am using MultipartEntityBuilder to create Entity in java. MultipartEntityBuilder needs boundary value to be set. but dropbox is not allowing it to send.
when i do that, i m getting below error.
Error in call to API function "files/upload": Bad HTTP "Content-Type" header: "text/plain; boundary=dRUj2TWABj74JeYRtJ2MYFIjWDyjWrAaMQE". Expecting one of "application/octet-stream", "text/plain; charset=dropbox-cors-hack".
could anyone please help ?
- Greg-DBDropbox Staff
The Dropbox API does not accept multipart requests, so you should not use MultipartEntityBuilder when constructing Dropbox API calls.
For information on what is expected for a call /2/files/upload, please refer to the documentation:
https://www.dropbox.com/developers/documentation/http/documentation#files-upload
As linked there, that endpoint is a "content-upload" style endpoint:
https://www.dropbox.com/developers/documentation/http/documentation#content-upload-endpoints
The data for the file you're uploading should be sent in the request body, with a "Content-Type" header or "application/octet-stream" of "text/plain; charset=dropbox-cors-hack". (The first one is preferred.)
If you're using Java though, we recommend using the official Java SDK, which will do most of the work for you:
https://github.com/dropbox/dropbox-sdk-java
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,877 PostsLatest Activity: 12 months 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!