================= upload.html =============
<html>
<head>
<script>
function uploadFile() {
var file_data = $('#thefile').prop('files')[0];
var form_data = new FormData();
form_data.append('file', file_data);
alert(form_data);
$.ajax({
url: 'upload.php',
dataType: 'text',
cache: false,
contentType: false,
processData: false,
data: form_data,
type: 'post',
success: function(data){
$('#result').html(data)
}
});
}
</script></head>
<body>
<input type="file" id="thefile" />
<input type="button" onclick="uploadFile()" value="send"/>
<div id='result'/>
</body>
</html>
================= upload.php ==============
<?php var_dump($_FILES) ?>
=========================================