1 Reply Latest reply on Apr 19, 2011 12:12 PM by neoX286

    Air FileReference.data

    neoX286

      How do I retrieve the data bytearray from a FileReference once it has been downloaded?  Everywhere I look online about this simply states that in a web browser this data is not accessible because it's a security issue, but in Air this is not an issue.  None of the places I've found that though have then proceeded to explain how to retrieve the FileReference.data information.

       

      Here's my workflow:

      --User selects attachment to download

      --FileReference runs it's download() function and prompts with a native air save dialog box

      --FileReference downloads the file and executes it's Event.COMPLETE listener, which calls my downloadComplete(Event) function

      --At this point inside the downloadComplete function I cannot grab the fileReference's data parameter because it's null, and the event.target.data value is also null

       

      What I'm trying to do with the bytearray data is then use FileStream to write a temp file out, then use the File class to execute the file with it's default application after the user clicks 'Open'.  Does anyone have any idea about how to actually grab the bytearray information though?