I'm using two upload controls for a multi file upload page. If the browser isn't HTML5 compatible it changes to a flash uploader. I wanted to create a consistent feel so I made my own custom progress area that looks the same for both. I'm wondering if I can manually throw the cancel event for a file in progress. Is there javascript I can call to cancel a file or do I have to use the built in file list area?
4 Answers, 1 is accepted
0
Hi Dave,
Thank you for your question. There is no direct way to call the cancel event through the API, but I can suggest you a workaround though - you can manually trigger the click event of the cancel button of Kendo Upload. This code should work for you, if you put it in the progress event handler:
I hope this will work in your case.
Regards,
Dimiter Madjarov
the Telerik team
Thank you for your question. There is no direct way to call the cancel event through the API, but I can suggest you a workaround though - you can manually trigger the click event of the cancel button of Kendo Upload. This code should work for you, if you put it in the progress event handler:
$(
".k-file:has([title='"
+ e.files[0].name +
"']) .k-cancel"
).click()
I hope this will work in your case.
Regards,
Dimiter Madjarov
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Daniele Bruno
Top achievements
Rank 1
answered on 08 Jan 2015, 09:36 AM
Hi Dimiter,
your solution works in Chrome, FF and Safari, but in IE8 it only Remove file from File list, but the HTTP request is not cancelled, so the server receives the file.
Do you have a workaround or another solution for IE8 ?
your solution works in Chrome, FF and Safari, but in IE8 it only Remove file from File list, but the HTTP request is not cancelled, so the server receives the file.
Do you have a workaround or another solution for IE8 ?
0
Daniele Bruno
Top achievements
Rank 1
answered on 08 Jan 2015, 09:39 AM
Hi Dimiter,
your solution works in Chrome, FF and Safari but in IE8 it olny remove the file from file List, but the http request is not canceled and the server receives the file.
Do you have a workaround or another solution for IE8?
your solution works in Chrome, FF and Safari but in IE8 it olny remove the file from file List, but the http request is not canceled and the server receives the file.
Do you have a workaround or another solution for IE8?
0
Hello Daniele,
The reason for this behavior is that the progress event is not fired in old Internet Explorer versions. Basically you could use the same approach, but not in the progress event handler - trigger the click of the cancel button.
Regards,Dimiter Madjarov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!