I'm sending files via AJAX with Jquery, using FormData()
, and then a question has arisen, why it works:
$.ajax({
url:"action/receipt.php",
method:"POST",
processData: false,
contentType: false,
data: form,
success:function(data){
}
});
And that's not it?
$.ajax({
url:"action/receipt.php",
method:"POST",
processData: false,
data: form,
success:function(data){
}
});
I mean, in the first way the variable $_FILES
prints the expected values, in the second it is empty.
Why does not filling in the content-type result in $_FILES
empty? Is it because the default is in a shipping format other than multipart/form-data
, or am I traveling?