When a file is uploaded I need to change the saveUrl to add parameters for a post. This code has no effect on the saveUrl.
function onUpload(e) {
var upload = e.files;
if (upload[0].extension != ".xml") {
alert("Only Xml files can be uploaded");
e.preventDefault();
}
else {
e.data = { fileName: upload[0].name };
kendoConsole.log("Upload :: " + getFileInfo(e));
}
//get the options and add to the Url
var option1 = $("#actions").val();
var postUrl = "PostViewData.svc/FileUpload/" + option1;
this.options.async.saveUrl = postUrl;
}
How can the saveUrl be modified?
$("#files").kendoUpload({
async: {
saveUrl: "PostViewData.svc/FileUpload",
autoUpload: false
},
multiple: false,
showFileList: true,
select: onSelect,
upload: onUpload,
success: onSuccess,
error: onError,
complete: onComplete,
cancel: onCancel,
remove: onRemove,
localization : { uploadSelectedFiles: "Upload"}
});
This is similar to adding a query string... saveUrl is already committed by the time the event onUploadFires?
function onUpload(e) {
var upload = e.files;
if (upload[0].extension != ".xml") {
alert("Only Xml files can be uploaded");
e.preventDefault();
}
else {
e.data = { fileName: upload[0].name };
kendoConsole.log("Upload :: " + getFileInfo(e));
}
//get the options and add to the Url
var option1 = $("#actions").val();
var postUrl = "PostViewData.svc/FileUpload/" + option1;
this.options.async.saveUrl = postUrl;
}
How can the saveUrl be modified?
$("#files").kendoUpload({
async: {
saveUrl: "PostViewData.svc/FileUpload",
autoUpload: false
},
multiple: false,
showFileList: true,
select: onSelect,
upload: onUpload,
success: onSuccess,
error: onError,
complete: onComplete,
cancel: onCancel,
remove: onRemove,
localization : { uploadSelectedFiles: "Upload"}
});
This is similar to adding a query string... saveUrl is already committed by the time the event onUploadFires?