Some thing in the lines...
HTML:
<input type="file" multiple onchange="handleFiles(this.files)">
JavaScript:
function handleFiles(files){
//create/associates a form with each file ("files.length" files)
// ... do stuff ...
}
function doAllSubmits(){
// for each form call "doAsubmit"
}
function doASubmit(some_id, callback){
// instantiate a XmlHttpRequest
// (or use jquery or any other library you're using)
// use a POST method
// (if I remember GET has(may have) query size limitations)
// populate with the form data
// plus the respective file data
// (maybe with readAsDataURL)
}
Some examples as to use the components cited:
Using_files_from_web_applications(MDN)
DOM/FileReader(MDN)