FileReference.onComplete, upload finish, or script finish ?

  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13503
  • Loc: Florida

Post 3+ Months Ago

When does Flash get notified that a file was successfully uploaded & fire the onComplete event ?
  • As soon as the server has saved the stream from the client computer ?
  • After a pre-processor (php, cfm, asp, ect) in the address the movie uploads to is finished running ?


Does this differ from pre-processor to pre-processor ?
If it differs, is it configurable, & how ?

I will be dealing with three filetypes, *.u, *.int, & *.zip that can contain either or both of the previous.

I need to perform extra actions for the *.u files, & I can detect the *.u files before uploading & have flash manage the extra actions, but if *.zip files contain *.u files, I will have to ask the server if the *.zip contained any *.u files since flash can't read the *.zip file contents.
I plan to make an XML.sendAndLoad POST request to retrieve either a list of *.u files or an empty rootNode once the FileReference.onComplete fires.

I'm not sure when that event is going to fire though, & it must happen after the script is finished so that the list it's looking for actually exists. :scratchhead:

I can use a timeout, or require user interaction to get the list if it comes down to it, but if that event fires after the pre-processor has run I don't need to take the time.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Posts: 1828
  • Loc: In the Great White North

Post 3+ Months Ago

what are you using to create the upload? I know that sendAndLoad fires a load (changes a variable, etc) at the end of the serverside script.

Is this in flash 9/AS3? I hear they've made a lot of updates to how the filesystem stuff works in the new version of flash.
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13503
  • Loc: Florida

Post 3+ Months Ago

Flash 8, AS2, flash.net.FileReference
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13503
  • Loc: Florida

Post 3+ Months Ago

I seem to be having an issue with retaining $_SESSION data in PHP when uploading through Flash, I'm going to attach a multi-timestamp via GET & use jerry-rigged sessions with XML files for the moment so I can test the original question.
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13503
  • Loc: Florida

Post 3+ Months Ago

Well, I found a few things out, the following is two logfile entries, both requests were made from Flash.

The top is an XML.sendAndLoad
The bottom is a FileReference.upload

request referer user_agent wrote:
"POST /upload.php?utime=1179845997515 HTTP/1.1" "http://joebert/test/index.php" "Opera/9.20 (Windows NT 5.1; U; en)"

"POST /upload.php?gid=1179845986984.1179846025656 HTTP/1.1" "-" "Shockwave Flash"


Flash seems to use its' own user-agent to handle uploads, this is why I couldn't retain any $_SESSION data when uploading, so I had to jerry-rig an sid with GET.
There's also no referrer sent, but given the security sandbox, & that ExternalInterface can be used to get the rreferrer, that shouldn't ever be a problem.

Now, to answer the original question, of weather FileReference.onComplete fires after the stream is uploaded, or after a pre-processor is able to run.

Testing on two different Apache installs on two different machines on two different operating systems (win32, Linux) using 1MB+ files, the pre-processor has been able to complete its' job before returning any status to the Flash player.

Post Information

  • Total Posts in this topic: 5 posts
  • Users browsing this forum: No registered users and 6 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.