【发布时间】:2018-05-29 16:34:48
【问题描述】:
我不断收到这个奇怪的错误,当我尝试设置我的授权标头时,我不断收到“InvalidStateError”。这是我的代码:
$("#files").kendoUpload({
async: {
saveUrl: myApiUrl + "/" + id,
autoUpload: true
},
upload: function(e) {
var xhr = e.XMLHttpRequest;
if (xhr) {
xhr.addEventListener("readystatechange", function onReady(e) {
if (xhr.readyState === 1 /* OPENED */) {
xhr.setRequestHeader("Authorization", "Bearer " + accessToken);
}
});
}
}
});
【问题讨论】:
标签: kendo-ui kendo-upload