You can see that the form submission is intercepted and sent using a special $.post() request:
$("#f").submit(function () {
var f = $("#f");
$.post(f.attr("action"), f.serialize(), function (result) {
close(eval(result));
});
return false;
});
You'll have to use FormData and $.ajax() in order to submit the data including the file.
See also:
https://stackoverflow.com/questions/21214608/jquery-ajax-single-file-upload
You might need to play with this snippet a little bit - as far as I can see the accepted answer uses this:
var fd = new FormData($("#fileinfo"));
which needs to be replaced with
var fd = new FormData($("#fileinfo")[0]);