angular-file-upload icon indicating copy to clipboard operation
angular-file-upload copied to clipboard

IE11 Appending Headers to my uploads

Open toddheslin opened this issue 9 years ago • 2 comments

Hey peeps! I'm absolutely loving this module, and coupled with the Dropbox 2.0 beta API it's super easy to allow uploads into a Dropbox 'App'. All browsers work fine except for IE (surprise, surprise).

Specifically, here is the issue:

When sending the upload to dropbox I set the header as:

"Content-Type" : "application/octet-stream"

However I'm getting a 400 response from dropbox saying:

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

So it appears that in IE the header I set is being appended and set to:

"application/octet-stream, multipart/form-data; boundary=---------------------------7df31c1b1101d6"

I assume it's because dropbox has a strict requirement and doesn't like the other headers that I'm receiving this error. If I can override the headers with only the ones I want, I'm guessing it will work.

If anyone has worked out a hack to this, please let me know.

Thanks so much!

toddheslin avatar Jun 06 '15 14:06 toddheslin

I am having the same issue as above, in my case, I used angular to set "Content-Type" : "multipart/form-data", and PUT operation to send a FormData, IE11 seems to change the header to: "multipart/form-data, multipart/form-data; boundary=---------------------------7df31c1b1101d6"

The duplicate "multipart/form" confused the server program, which replied a 415 response - Unsupported media type.

any help?

libinkm avatar Dec 16 '15 20:12 libinkm

+1 Same issue here. Anyone found a fix?

eablokker avatar Jan 10 '18 01:01 eablokker