I am trying to upload file to my application in download folder. But it doesn't show complete.
It show me to retry in Image but show alert message for error and also for complete. How Could i do that . I given my code below.
<div style="width:45%">
@(Html.Kendo().Upload()
.Name("files")
.Async(a => a
.Save("Save", "Upload")
.Remove("Remove", "Upload")
.SaveUrl("~/download/")
.AutoUpload(true)
)
.Events(events => events
.Cancel("onCancel")
.Complete("onComplete")
.Error("onError")
.Progress("onProgress")
.Remove("onRemove")
.Select("onSelect")
.Success("onSuccess")
.Upload("onUpload")
)
)
</div>
<script>
function onSelect(e) {
alert("Select :: " + getFileInfo(e));
}
function onUpload(e) {
alert("Upload :: " + getFileInfo(e));
}
function onSuccess(e) {
alert("Success (" + e.operation + ") :: " + getFileInfo(e));
}
function onError(e) {
alert("Error (" + e.operation + ") :: " + getFileInfo(e));
}
function onComplete(e) {
alert("Complete");
}
function onCancel(e) {
alert("Cancel :: " + getFileInfo(e));
}
function onRemove(e) {
alert("Remove :: " + getFileInfo(e));
}
function onProgress(e) {
$("#details").val("Upload progress :: " + e.percentComplete + "% :: " + getFileInfo(e));
}
function getFileInfo(e) {
return $.map(e.files, function (file) {
var info = file.name;
// File size is not available in all browsers
if (file.size > 0) {
info += " (" + Math.ceil(file.size / 1024) + " KB)";
}
return info;
}).join(", ");
}
</script>