2 Replies Latest reply on Aug 2, 2011 6:05 AM by Rangora

    Can AIR create a file in localsystem ?

    Benoitcn Level 1

      I want to store some data in a file in the local system specified path or application path.

      What class should I use ?

        • 1. Re: Can AIR create a file in localsystem ?
          flexillu10 Level 1

          Yes, use a sharedObject, or you can use var file:File = File.applicationStorageDirectory.resolvePath("/path/to/file.ext")

          • 2. Re: Can AIR create a file in localsystem ?
            Rangora Level 3

            Somethign like this


                var file:File = File.applicationStorageDirectory.resolvePath("image/" + name);
                var fs:FileStream = new FileStream();

                            //open file in write mode
                            trace("File is opened to write the contents");


                           //write bytes from the byte array
                            trace("File write is Completed");

                            //close the file
                            trace("File is closed after writing the contents");

                            trace("File write error: " + e.message);