Hello,
This example is used with XHR for asynchronous upload.
The "start" part is just to receive the filename and create the file, setup session, setup loading bar on the webpage etc. It's just a normal ajax call to the server to make sure everything is set up.
$.get("/WebFileUpload.hal?action=start&session=" + session + "&newname=" + newname + "&filename=" + filename,function(data){...});
"file" is the only place where XHR is actually used. The way this is setup it can handle breaking up larger files and uploading them as parts
if you want the upload to actually work in blocks you need to handle breaking the file apart in JavaScript and send piece by piece with XHR, the server-side code will just append everything it gets to the file.
xhr.open('POST', "/WebFileUpload.hal?action=file&session=" + session + "&tmpname=" + tmpname +"&fn=" & fn, true);
"end" is also just a standard ajax call to finalize upload, move file to proper location, delete the temporary one and clean up the loading bar on the webpage.
$.get("/WebFileUpload.hal?action= end&session=" + session,function(data){...});