1var fd = new FormData();
2fd.append( 'file', input.files[0] );
3
4$.ajax({
5 url: 'http://example.com/script.php',
6 data: fd,
7 processData: false,
8 contentType: false,
9 type: 'POST',
10 success: function(data){
11 alert(data);
12 }
13});