I need submit a file for PHP Script using $.ajax({}) JQuery native.
I try to do something like this,
<input id="my_file" name="my_file" type="file">
//some code
$.ajax({
type: 'post',
data: {my_file:$("#my_file").val()}
url : 'someurl.php'
});
When I receive the POST variable, it have the filename.
How I can send the file using this way?