I'm struggling trying to upload two files to a php script and let the page download a new merged file without redirecting to a second page.
I don't want to cache any file on the server, because they could be large (2MB) binary files.
looking at this question:
Download a file by jQuery.Ajax
it seems that the jQuery File Upload plugin cannot handle uploads. There is an example posting a text. But it seems that file uploads don't pass through when the data gets serialized.
$(document).on("submit", "form.fileDownloadForm", function (e) {
$.fileDownload($(this).prop('action'), {
preparingMessageHtml: "We are preparing your report, please wait...",
failMessageHtml: "There was a problem generating your report, please try again.",
httpMethod: "POST",
data: $(this).serialize()
});
e.preventDefault(); //otherwise a normal form submit would occur
});