cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Update: Find information on Dropbox support during COVID-19 here
Close

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: 
Highlighted

Dropbox v2 API Content-Type header

Explorer | Level 3

For confirmation:

 

Is it allowed to use Content-Type header other than "application/octet-stream" and "text/plain; charset=dropbox-cors-hack" when uploading file using Dropbox v2 API (https://content.dropboxapi.com/2/files/upload)?

 

I have tried using other Content-Type value (example: multipart_form_data) but an error is always returned.

 

Error in call to API function "files/upload": Bad HTTP "Content-Type" header: "text/plain; charse=dropbox-cors-hack". Expecting one of "application/octet-stream", "text/plain; charset=dropbox-cors-hack".

 

5 Replies 5
Highlighted

Re: Dropbox v2 API Content-Type header

Dropboxer
Dropboxer
No, the API only accepts the Content-Type values mentioned as expected in the error message.
Highlighted

Re: Dropbox v2 API Content-Type header

Explorer | Level 3
Does Dropbox v2 have any specification regarding this?
Highlighted

Re: Dropbox v2 API Content-Type header

Dropboxer
Dropboxer
What information exactly are you looking for? You can find the documentation for the HTTP interface here:

https://www.dropbox.com/developers/documentation/http/documentation

The specification for the API can be found here:

https://github.com/dropbox/dropbox-api-spec
Highlighted

Re: Dropbox v2 API Content-Type header

Explorer | Level 3

Specification regarding the Content-Type value for uploading files using Dropbox v2 API.

That only these Content-Type values can be used.

"application/octet-stream", "text/plain; charset=dropbox-cors-hack"

 

Highlighted

Re: Dropbox v2 API Content-Type header

Dropboxer
Dropboxer
I don't believe that's called out specifically in the documentation, but that information from the error message is correct. (It's also shown in the curl examples.)
Polls
Do you know how to organize your files and folders?
We have created a guide on folder best practice, so you can get organized now check it out here.

Work Smarter with Dropbox

The way we work is changing. Share and discover new ways to work smarter with Dropbox in our community.

Sound good? Let's get started.
Who's talking

Top contributors to this post

What do Dropbox user levels mean?
Need more support?