Possible Duplicate:
How can I upload files asynchronously with jQuery?
How to use ajax post a upload file sametime I need to post a string check = 1?
data: fd + '&check=' + 1,
this is not work. any suggestion?
Thanks.
var uf =$('.formname');
var fd = new FormData(formname);
$.ajax({
type: "POST",
url: 'http://example.com/script.php',
data: fd,
processData: false,
contentType: false,
success: function(data){
}
});
php
if($_FILES && $_POST['check'] == 1)