[英]Ng-file-upload progress bar not working with offlinejs
我在家中使用ng-file-upload进行文件上传,而且好消息是它可以正常工作并且可以上传文件。
问题是,仅当我在index.html中禁用offlinejs时,进度条才会显示。 似乎offlineJS我阻止了post调用的进度回调。
这是我得到的错误信息:
Error: Failed to execute 'setRequestHeader' on 'XMLHttpRequest': 'function (xhr) {
if (!xhr || !(xhr instanceof XMLHttpRequest)) return;
config.__XHR = xhr;
if (config.xhrFn) config.xhrFn(xhr);
xhr.upload.addEventListener('progress', function (e) {
e.config = config;
notifyProgress(getNotifyEvent(e));
}, false);
//fix for firefox not firing upload progress end, also IE8-9
xhr.upload.addEventListener('load', function (e) {
if (e.lengthComputable) {
e.config = config;
notifyProgress(getNotifyEvent(e));
}
}, false);
}' is not a valid HTTP header field value.
at Error (native)
at XMLHttpRequest.f.setRequestHeader (http://localhost:3000/lib/js/offline/offline.min.js:2:3272)
该问题已在最新版本的ng-file-upload中修复!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.