jQuery的文件上传blueimp - 额外的标题 [英] jQuery-File-Upload by blueimp - additional headers

查看:171
本文介绍了jQuery的文件上传blueimp - 额外的标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我搜索了 wiki ,但找不到答案我应该在JS脚本中添加额外的头文件(例如 Authorization 头文件)吗?某处 onSend / beforeSend 或?



小部件链接: https://github.com/blueimp/jQuery-File-Upload

您是否尝试通过options.headers对象设置额外的标头? b

如果使用 forceIframeTransport:true 选项(IE不支持XHR文件上传,则需要使用隐藏的iframe方法),那么修改标题不是一个选项: https://github.com/blueimp/jQuery-File-Upload/issues/654



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




为文件上传插件设置的选项传递给jQuery.ajax()并允许定义任何ajax设置或回调。


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 onSend/beforeSend or?

Widget link: https://github.com/blueimp/jQuery-File-Upload

解决方案

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.

这篇关于jQuery的文件上传blueimp - 额外的标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆