I think you've got 2 basic questions here:
- How to select local files for upload via flash?
- How to send multiple files to server as POST?
For #1 You need to use flash.net.FileReference.
For #2 There's no built-in 'Multipart' loader in flash, which I'm pretty sure is what you need. The best one I've found is by this genius developer named Eugene: http://blog.inspirit.ru/?p=198. This works great, though personally had I've some issues with the onComplete handler in IE8 & IE9. I'm sure it's IE's fault and not Eugene's. I worked around this my listening for the HTTPStatusEvent event like so:
var ml:MultipartURLLoader = new MultipartURLLoader();
ml.addEventListener(HTTPStatusEvent.HTTP_STATUS, onHTTPStatusEvent);
ml.addVariable('Content-Type', "image/png");
ml.addFile(pngStream, filename, "file", "image/png");
ml.load('http://...');
function onHTTPStatusEvent( event: HTTPStatusEvent ){
if(stat == 0 || (stat >= 200 && stat < 205)){
//upload success
}else{
//some kinda error
}
}
(This should work with multiple addFiles(_);)
I'm also listening for the standard events:
ml.addEventListener(Event.COMPLETE, uploadComplete);
ml.addEventListener(ProgressEvent.PROGRESS, uploadProgress);
But haven't been able to get PROGRESS to work at all, and COMPLETE doesn't fire on IE... Anyone know any alternatives that work on IE? Eugene's code is working for me now, but I don't think I can add a "uploading..." progress bar as it is... which would be cool.