Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
518 B
1
Indexable
Never
$("#jquery-upload-button").on("click",function(){
   let formData = new FormData();
   let file = $('#file')[0].files[0];
   formData.append('file',file);
   $.ajax({
      url : 'upload.php',
      type : 'post',
      data : formData,
      contentType : false,
      processData : false,
      success : function(data){
         if(data != 0){
            alert('Succesful jQuery file upload ' + data);
         }else{
            alert('jQuery file upload error.');
         }
      },
   });
});