This content has been marked as final. Show 4 replies
I don't have an answer, but I need to be able to do something similar in the near future.
Could you do it in a 2-stage process? I.e. send an httpService request when the "complete" event fires. This would probably mean maintaining some kind of "session data" on the server. But you can send other data as part of the urlRequest used by the FileReference upload. It may be possible to use that to help when processing the "follow-up" request.
If you find a solution, please post it.
Thanks for the reply. I see what you are saying and you're right, we could definitely do it in 2 stages. It would just be really nice to do it in one step avoiding maintaining the state on the server for something simple like this.
I can't find any hints or clues in the docs about how to do this either. So, I am wondering if it is just a limitation of Flash file uploading and if so, why is it a limitation?
Well I'm an idiot The answer was right there in the docs...
The FileReference object will dispatch a uploadCompleteData event that you can listen for, and when it fires use the data property to extract the server's response
var mUploadURLRequest:URLRequest = new URLRequest( _uploadURL );
private function onUploadCompleteData( e : DataEvent ) : void
var data : Object = e.data;
trace( ObjectUtil.toString(data) );
Thanks for that. I feel like an idiot too. I sometimes wonder whether the docs are animated in some way. This isn't the first time I've missed something that was staring me in the face.