views:

483

answers:

1

Hi!

I need to write a ByteArray to a file on local disk with Flash AS3. The flashapplication is run locally (it's a projector exe).

I found the FileReference class with the save() function which works perfect. The only problem is, that this function opens a filebrowser and let's the user select where to store the file. However - i have the path already as string and need to save to this location without useraction (since i'm exporting a lot of files into this directory in one go and don't want the user to choose each one manually).

Is there a way to store a bytearray from a projector to local disk without opening a filebrowser?

I'm also using mdm Zinc, which actually provides a function to save a ByteArray to disk, but this function is for some unknown reasons not working. I already filed a bugreport, but I need to get this to work very urgently, so i'm looking for alternatives!

Thanks!

+1  A: 

If all you need is persistence (you read what you write), you can take a look at SharedObject.

Mihai Nita
no i actually need to write to disk. The tool shall export jpg files which are auto generated in the application (i have them as ByteArray data, but i need to write them to disk at specific locations).And it should be possible without using AIR
genesys
Then the answer is: no, not possible without AIR and without a dialog asking for user's permission. Imagine if that would be possible: any random web site would be able to store 400 GB of data on your disk.
Mihai Nita