I have a form that uploads a file, I process the inline file using ajax, but I do not know how I can get data using ajax.
In my script, I use this method:
$.ajax(
{
type: "POST",
url: "upload.php",
data: ({ file : '???' }),
success: function(msg)
{
$('#upload_box').html(msg);
}
});
How can I declare a file 'file' to receive file data? (file name, tmp_name, type, size, etc.).
source
share