Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

jquery serialize with file upload

<form> 
   <p>Upload file: < input type = "file" name = "file" / ></p> 
   < input type = "button" value = "Upload" onclick = "upload()" / > 
</form>
function upload() { 
   var formData = new FormData($("#uploadForm")[0]); 
   $.ajax({ 
     url: '', 
     type: 'POST', 
     data: formData, 
     async: false, 
     cache: false, 
     contentType: false, 
     processData: false, 
     success: function(data) {
     }, 
     error: function(data) {   
     } 
   }); 
}
Source by developpaper.com #
 
PREVIOUS NEXT
Tagged: #jquery #serialize #file #upload
ADD COMMENT
Topic
Name
7+9 =