<form>
<p>Upload file: < input type = "file" name = "file" / ></p>
< input type = "button" value = "Upload" onclick = "upload()" / >
</form>
function upload() {
var formData = new FormData($("#uploadForm")[0]);
$.ajax({
url: '',
type: 'POST',
data: formData,
async: false,
cache: false,
contentType: false,
processData: false,
success: function(data) {
},
error: function(data) {
}
});
}