or
Hi Guys,
Is there a quick way to remove files from a Kendo UI Upload plus fire the corresponding remove request on the server? I have a Kendo UI Form where I added the Kendo Upload. When the user clicks the Clear button in the form, the files are removed from the list however the remove request is not fired thus, the uploaded files are still in the server.
This is the code snippet on how I have added the kendo upload to the kendo form:
$('<input type="file" name="' + options.field + '" id="' + options.field + '"/>').appendTo(container)
.kendoUpload({
multiple: false,
async: {
saveUrl: "/api/upload/save",
removeUrl: "/api/upload/remove"
},
validation: {
allowedExtensions: [".jpg", ".gif"]
},
upload: (e: kendo.ui.UploadUploadEvent) => {
e.data = { uploadId: this._uploadId };
},
remove: (e: kendo.ui.UploadRemoveEvent) => {
e.data = { uploadId: this._uploadId };
},
success: (e: kendo.ui.UploadSuccessEvent) => {
this.enableSubmit(e.operation === 'upload');
}
})
I have tried using the removeAllFiles() or removeFile() but doesn't seem to do any request calls.
Hoping to hear from you soon.
Kindest regards, Ruby.
How to add upload widget inside form widget.
Like the combobox in the sample of forms. I need to put upload file inside the form.
thanks.