次のjsを使用してファイルをアップロードするときに、剣道UIアップローダーが問題なく動作しています。
$(function () {
//uploading
$("#filename_trigger").kendoUpload({
async: {
autoUpload: true,
saveUrl: $("#upload_url").val(),
removeUrl: $("#delete_upload_url").val(),
removeField: "filename",
saveField: "filename"
},
select: function (e) {
$.each(e.files, function (index, value) {
ext = value.extension.toLowerCase();
if (ext != '.jpg' && ext != '.png') {
alert('Only images are allowed!');
e.preventDefault();
}
});
},
success: function (e) {
alert(e.operation);
if (e.operation == "upload") {
// Array with information about the uploaded files
var files = e.files;
$("#filename").val(e.response.filename);
pushNotification("File uploaded");
}
if (e.operation == "remove") {
pushNotification("File removed");
}
}});
});
ただし、ファイルの削除に関しては、div からファイルが削除されるわけではありません。関数を使用して responseStatus を出力すると、それは問題ないと表示され、ファイルは実際にはサーバーから返された 200 ヘッダーで削除されます。エラーがスローされる理由はありますか?削除が成功したことを知るために、特定の文字列を返す必要がありますか?
乾杯、