I am trying to transfer the file in the following way:
$('input[type="file"]').on('change', function(e) { var nm = this.value.replace(/\\/g, '/').replace(/.*\//, '') var datf = this.files[0]; $.ajax({url: "sent.php", data: {'name': nm, 'file': datf}, processData: false, contentType: false, type: 'POST', success: function(ev) { alarm(ev); }})}) In the script sent.php, if you print the entire array $GLOBALS , then $_FILES and $_POST are empty. What is wrong here?
PS Something is in HTTP_RAW_POST_DATA - string(15) "[object Object]" What could be there?