jQuery-File-Upload by blueimp - additional headers

前端 未结 5 1786
野的像风
野的像风 2021-02-05 11:19

I\'ve searched through wiki but couldn\'t find an answer where should I put my additional headers (for example Authorization header) in JS script? Somewhere o

5条回答
  •  盖世英雄少女心
    2021-02-05 11:53

    Did you try to set additional headers through "options.headers" object?

    If using the forceIframeTransport: true option (with IE not supporting XHR file uploads you need to fall back on the hidden iframe approach), then modifying headers is not an option: https://github.com/blueimp/jQuery-File-Upload/issues/654

    Options.headers: http://api.jquery.com/jQuery.ajax/

    The options set for the File Upload plugin are passed to jQuery.ajax() and allow to define any ajax settings or callbacks.

提交回复
热议问题