How To Cancel A File Upload By Clicking On A 'cancel' Button
I have a form which contains a file input within the form and more importantly a cancel button which should cancel a file upload: var $fileImage = $('
Solution 2:
There is a possible solution. You can do like that:
$("#cancel").click(function(){
$("#inputfile").remove();
$("#containerof_inputfile").append("<input type=\"file\" id=\"inputfile\"/>");
});
Solution 3:
jQuery makes this kind of thing easier. You can call abort on a returned jQuery object. I suppose you can look in the jQuery code to see how it does it if you really want to roll your own.
Edit: I got curious and looked it up. Abort is a method of the XMLHttpRequest function in Javascript.
Post a Comment for "How To Cancel A File Upload By Clicking On A 'cancel' Button"