Monday, 15 July 2013

jquery - html file 2 time browsed 3 time browsed when page is not refreshed -


I have a link on that link that I am browsing the input type file, for the first time I upload the file Using AJAX is working fine, but when I upload a new file twice or 3 times on the next upload, how many files I browse in the last (first) upload. I want to reset the file when I reload the wall while posting. / P>

These are html and java script code below: -

  input type = "file" id = "uploadfile" name = "uploadfile" style = "display: none ; "Value =" "/> & Lt; Script & gt; $ ('# Applus') Click (function (e) {$ ('# uploadfile'). Click (); $ ('# photo_video') Show (); return returned;}); $ (Document) .ready (function () {$ ("# uploadfile"). Change (function (e) {$ ('# img_upload_process'). Show (); var file = document.getElementById ("uploadfile"); Var filen = document.getElementById ("uploadfile") .pir; var fff = file.files [0]; formdata = false; var formatta = new form data (); formadata .append ("upload", file.files [0 ];;); If (file) {$ .ajax ({url: "upload.php", type: "POST", data: formData, mimeType: "multipart / form-data", contentType: false, cache: false, ProcessData: incorrect, success: function {$ ('# response image'). Attachment; var duplicate CHk = {}; $ ('input [id]'). (Function () {if (duplicateChk .hasOw NP Roperty (this.id)) $ $ (this) .remove ();} and (duplicate Chk [this.id] = 'true';}}); $ ('# img_upload_process') to hide (); $ ("# Uploadfile") value (""). Document.getElementById ("MyForm") reset (); $ ("# MyForm") [0] .reset ();}})}}})}} ; & Lt; / script & gt;  

To pause commands at the end of each link Try


No comments:

Post a Comment