When the user clicks Cancel, the filename is removed from the list on the page, but I noticed the actual file fragment still exists on the server. Is there any way to also delete the cancelled file from the file system? I tried adding removeFileByUid() to the onCancel function, but I get the following JavaScript error:
Uncaught ReferenceError: upload is not defined
at init.onCancel ((index):96)
at init.trigger (kendo.all.js:164)
at init._onFileAction (kendo.all.js:71201)
at HTMLButtonElement.d (jquery.min.js:2)
at HTMLDivElement.dispatch (jquery.min.js:3)
at HTMLDivElement.r.handle (jquery.min.js:3)
onCancel @ (index):96
trigger @ kendo.all.min.js:25
_onFileAction @ kendo.all.js:72295
d @ jquery.min.js:2
dispatch @ jquery.min.js:3
r.handle @ jquery.min.js:3
I assume this is because my removeFileByUid() call runs before the built-in "Cancel" code, which is also trying to remove the file that was already removed...?
I also tried making an Ajax call to my C# "remove" function directly, and I get the following error: "The process cannot access the file...because it is being used by another process."
For reference, here is my uploader:
Uncaught ReferenceError: upload is not defined
at init.onCancel ((index):96)
at init.trigger (kendo.all.js:164)
at init._onFileAction (kendo.all.js:71201)
at HTMLButtonElement.d (jquery.min.js:2)
at HTMLDivElement.dispatch (jquery.min.js:3)
at HTMLDivElement.r.handle (jquery.min.js:3)
onCancel @ (index):96
trigger @ kendo.all.min.js:25
_onFileAction @ kendo.all.js:72295
d @ jquery.min.js:2
dispatch @ jquery.min.js:3
r.handle @ jquery.min.js:3
I assume this is because my removeFileByUid() call runs before the built-in "Cancel" code, which is also trying to remove the file that was already removed...?
I also tried making an Ajax call to my C# "remove" function directly, and I get the following error: "The process cannot access the file...because it is being used by another process."
For reference, here is my uploader:
@(Html.Kendo().Upload()
.Name("files")
.Async(a => a
.Save("Chunk_Upload_Save", "Home")
.Remove("Async_Remove", "Home")
.AutoUpload(true)
.ChunkSize(1024000) //bytes
)
.Events(events => events
.Cancel("onCancel")
)
)