Search code examples
internet-explorerhttp-headersinternet-explorer-9fine-uploader

Does Fineuploader have a workaround for custom headers in Internet Explorer 9?


I need to send a csrf token along with my image uploads. Using request.customHeaders works great in all browsers except IE <= 9

this.uploader = new qq.FineUploader({
  request: {
    customHeaders: {
      'X-CSRF-Token': csrf-token
    }
  }
});

I don't really care about IE8 but I need to send a CSRF token with my uploads in IE9. How do I do this when Fineuploader doesn't support customHeaders:

console.log('IE9 Custom Header Supported: ', qq.supportedFeatures.uploadCustomHeaders());
// IE9 Custom Header Supported: false

Solution

  • Since uploads must be implemented as forms submits that target hidden iframes in IE9 and older, there is no way to send custom headers with the request.

    You have two options:

    • Parameters (sent in the payload of the form submit POST request)
    • Cookies (which will be sent along with the request by the browser)