I'm uploading some files to a server. On Mac OSX the Event.COMPLETE listener does not work. It works fine on Windows, but not on OSX.
So, to test if a file is complete I'm monitoring the ProgressEvent.PROGRESS listener. This works pretty well most of the time on OSX and 100% of the time on Windows.
My problem is that when I try to upload files that are about 100kb or smaller on OSX, the file apparently uploads so fast that a ProgressEvent is never fired or it's missed and so my script doesn't know the file is complete. I'm testing if bytesUploaded == bytesTotal and small files never seem to register anything in the ProgressEvent. However, files larger than 100kb and up seem to work file and the progress bar moves and I can register when the file is done. This is only OSX.
Is there way that I can somehow speed up how fast the ProgressEvent is called to listen so it can catch small files' progress?
Any ideas on how to overcome this? I wish Event.COMPLETE would work on OSX with my host but it simply won't after weeks of testing we can't get it to work so monitoring the ProgressEvent is the only other alternative method of trying to tell whether a file is complete or not. If anyone has any "Plan C" ideas I'm open to that too.
If my memory is not cheating on me then this is a Mac issue. The solution would be to send some additional data, like an empty echo that would force the COMPLETE event to trigger. Try googling for this issue because I'm sure that you'll run over a few articles that can help you out if you insist a bit.
With best regards
EDIT: Yeah, I found the post on my blog where someone said that he ran over the same problem. http://blog.wisebisoft.com/2009/01/28/simple-flex-file-uploader/ Read Valentijn's reply.
Thank you so much for your link to the information. I've been struggling with this problem for a while and your tip led to the solution.
For those seeking relief from this type of fileReference problem on a Mac where Event.COMPLETE does not work...I simply added the following line to the ending of my PHP script:
echo " ";
Make sure there is a blank space between the quotes.
After doing this my file uploading works on a Mac now as it should. Unbelievably simple.