cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
We've been busy working on some major updates to the Community, so check out what's changing, what’s staying the same and what you can expect from the Dropbox Community right 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: 

Unable to upload the file via API

Unable to upload the file via API

iosenqa
Explorer | Level 4
Go to solution

Unable to upload the files using API , see the Poster screenshot for paramaters and Body. Any help would be really appreciated.

Seeing below error : 

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

 

ParamatersParamaters

 

Screen Shot 2019-02-26 at 3.51.26 PM.png

 

1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution

The Dropbox API /upload endpoint does require that the HTTPS request use one of the Content-Type values listed in the error message you shared.

I see that you are attempting to set a valid Content-Type value, but the actual request is using a different value ("multipart..."). It seems that the HTTPS client you're using is overriding the value you're attempting to set.

You should refer to the documentation for the client you're using to determine how to disable that behavior. For instance, you likely will want to use the "binary" option seen in the screenshot of the "Body" tab you shared. 

Also, note that some of your other headers look incorrect as well. The Dropbox API parameters should be sent as JSON in a single "Dropbox-API-Arg" header, not in separate "mode", "autorename", etc. headers like you have. You can find more information and an example in the documentation.

View solution in original post

2 Replies 2

Greg-DB
Dropbox Staff
Go to solution

The Dropbox API /upload endpoint does require that the HTTPS request use one of the Content-Type values listed in the error message you shared.

I see that you are attempting to set a valid Content-Type value, but the actual request is using a different value ("multipart..."). It seems that the HTTPS client you're using is overriding the value you're attempting to set.

You should refer to the documentation for the client you're using to determine how to disable that behavior. For instance, you likely will want to use the "binary" option seen in the screenshot of the "Body" tab you shared. 

Also, note that some of your other headers look incorrect as well. The Dropbox API parameters should be sent as JSON in a single "Dropbox-API-Arg" header, not in separate "mode", "autorename", etc. headers like you have. You can find more information and an example in the documentation.

iosenqa
Explorer | Level 4
Go to solution

after following the suggestions you mentioned, It works great. Now trying out retrieve features of the files.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    iosenqa Explorer | Level 4
  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?