2 Replies Latest reply on Aug 14, 2008 3:08 AM by Starlover_jacob

    load db file

    Starlover_jacob Level 1
      Hi there,

      I need to load a .db file so i can convert it to a bytearray and save the file in a .zip for my backup function.
      But when I use the load functionality I get the error;
      Error #2044: Unhandled IOErrorEvent:. text=Error #2124: Loaded file is an unknown type.

      Is there a way to load the .db file so i can use it?
      Please some help.

      Here the code i used:
        • 1. Re: load db file
          Peter Lorent Level 2
          This is probably AIR related. Head over to the AIR forum. The engineers seem to answer these kinds of questions.
          • 2. Re: load db file
            Starlover_jacob Level 1
            Hi there,
            Thanx for the answer.. I didn't notice there was an air forum ;) I will use that the next time i have air related questions.


            For now this solved my problem:

            var myfilestream:FileStream;
            var thisfile:File;
            var thisfilename:String;

            thisfilename="mydatabase.db";
            thisfile = File.applicationStorageDirectory.resolvePath(thisfilename);

            myfilestream.open(thisfile, FileMode.READ);
            myfilestream.readBytes(fileData, 0, thisfile.size);
            myfilestream.close();


            this reads my file, so i can save the bytearray into my zip file.