Advertisement
firestorm_dev

amazed upload

May 17th, 2017
272
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $('#upload_file').submit(function(e){
  2.  
  3.         e.preventDefault(); // Prevent Default Submission
  4.        
  5.         $.ajax({
  6.           url: 'includes/uploads.php',
  7.           type: 'POST',
  8.           data:  new FormData(this),
  9.            contentType: false,
  10.                  cache: false,
  11.            processData:false,
  12.            beforeSend: function() {},
  13.         })
  14.        
  15.         .done(function(data){
  16.             alert('Form Submit Successful ...');
  17.         })
  18.        
  19.         .fail(function(){ // If fail display alert
  20.             alert('Form Submit Failed ...');
  21.         });
  22.        
  23.     });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement