This content has been marked as final. Show 2 replies
OK, I still haven't been able to get the complete event to fire. Has anyone had any luck with this using the FileReferenceList? I did a "tcpdump" on my machine and I can see that the browser is recieving the HTTP 200 code from server and the server is successfully uploading the files.
Has there been any bugs on this? Anybody got any hints?
My only other solution is too compare the bytesloaded with the bytestotal from the progress event and shoot off the complete event myself - which is a total hack, but I'm not sure what else to do.
It appears, that unless you keep a handle on the FileReference object, the flash engine will garbage collected it real quick. Which is what was happening here - even though the files were being sent to the servlet with no problem, the garbage collector was sucking up the FileReference objects before they could dispatch the complete event.
So, the solution here, was to place the FileReference object in an array just before the upload command and then, remove it from the array when the complete event is fired, so the garbage collection can collect it at the proper time.
This was actually in the documentation somewhere, but for some reason it just didn't register.
Anyhoo.... there is a good example of what to do on the lang spec in the FileReferenceList page under the examples.
Hopes this helps... someone. :-)