I have one file input and i want to upload selected file with jquery ajax.
My input like this
<form id="formWithFiles">    
  <input type="file" name="file">
</form>
My upload jquery code
$("input[name='file']").on('change',function(){
  $.ajax({
    url: 'du.asp', 
    type: 'POST',
    contentType:'multipart/form-data',
    data: new FormData($('#formWithFiles')[0]),
    processData: false, 
    success:function(data){
      console.log(data);
    }
  });
});
My Upload Classic Asp Code - du.asp
Set Upload = Server.CreateObject("Persits.Upload")
Upload.CodePage = 65001
Upload.OverwriteFiles = False
Temp = Server.MapPath("content/temp")&"/"
Upload.Save(Temp)
Problem is here; I am getting a
500 Internal Server Error
error with jquery ajax. But if i use form submit method then file uploading with du.asp.
Detailed Error (Just using ajax)
Boundary not found in Content-Type. Make sure you have included the attribute ENCTYPE="multipart/form-data" in your form.
