I apologize in advance as I believe this is a PHP issue but I am hoping somebody that is using SFWUpload may have encountered this.
I have a script that accepts a file for upload, does some resizing and then stores the file on Amazon S3. When I use a test form and submit a file to it everything works great. When I use the SWFUpload, the file uploads successfully but the script terminates before processing is complete. It seems to me that perhaps the SWF component is closing the connection before the script completes but it could be that the script is returning a 200 message prior to finishing the processing.
Does anybody know if I am on the right track here or if there is a way to delay the 200 status code message from being sent until processing is done or make the SWF component keep the connection open longer even if it receives a 200 status code?
I am using apache2 on linux with php5 and the latest beta of the SWFUpload component.
I should add that this
I should add that this occurs in IE7 and Google Chrome which are the two browsers I am testing with presently.
More than 30 seconds
The only issue I know is that Flash only waits 30 seconds after the upload has completed for the script to finish. After that it just gives up, closes the connection (which may or may not terminate the server script) and then never calls any events (thank you Adobe).
The only work around I know of is to force your upload script to send output to the client periodically while it processes. You'll probably have to force any buffers to flush to make sure the output gets sent to the client right away.
I found the 30 second thing
I found the 30 second thing in the documentation. This is happening immediately. When I test the script with a normal HTML file form, I can watch the file that is being uploaded increase in size. Once it hits the total file size, it sticks around in the tmp folder for a few seconds (usually 2-3) and then gets deleted. When I use the SWFUpload component, I can watch the file size increase in the tmp folder but it is deleted immediately after the file is finished uploading.
It appears now that the upload script is finishing because I have some DB queries that run at the end of the script. It looks like PHP is deleting the tmp file before the script is finished executing.
Found the Problem
The problem was a difference in the $_FILES array from when I did an HTTP post versus the SWFUpload post.
In the HTTP post, the tmp_name was an array with the first element in the array being the location.
In the SWFUpload, the tmp_name was a string.
So the code $_FILES[...]['tmp_name'][0] which worked for an HTTP post returned the first character of the string for the SWFUpload post.