2 Replies Latest reply on Mar 17, 2008 1:33 PM by Adam_Boas

    Accessing Files

    Adam_Boas Level 1
      I am hoping someone will be able to help me with accessing file data. I am currently able to upload a file using the FileReference class and it's browse() and upload() functions. Unfortunately since I am using remoting via BlazeDS, I prefer to send a proper object with a byte[] rather than doing a clumsy file upload and reconstructing the object back at the server.

      The problem is that when the FileReference SELECTED event goes off, all I can do is call upload(). The event.target is the FileReference itself, rather than the File... very frustrating. Any help on this would be much appreciated.
        • 1. Re: Accessing Files
          JKohn99 Level 1
          You cannot get to the file from Flex. SandBox security does
          not allow access to the local file system. I haven't played with AIR yet, but I assume that AIR can read local files.

          Remember that you are creating Web applications with Flex so the same security restrictions apply that you would see in an applet.
          • 2. Re: Accessing Files
            Adam_Boas Level 1
            Thanks JKohn99, I suspected this was the case. I was just hoping that functionality similar to the html file control would be available. I don't want to save to the local file system, just send it in an object via AMF rather than doing a POST.