cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Expecting one of "application/octet-stream", "text/plain; charset=dropbox-cors-hack".

Expecting one of "application/octet-stream", "text/plain; charset=dropbox-cors-hack".

Mayil
Explorer | Level 3

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 ?

1 Reply 1

Greg-DB
Dropbox 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

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?