views:

294

answers:

2

hi,

I need to save the file in the particular directory.

i tried with the below code its working. but its opening the dialog box to choose the path wher the file to be saved.

var texT:String="Hi this to be saved";

var file:FileReference = new FileReference(); file.save(texT,"myfile12.Text");

But i need to save the file like this

var file:FileReference = new FileReference(); file.save(texT,"c:\ProjectFolder\XmlFile\myfile.Text");

Its not working. How to solve this this problem!!!!!!!!1

Thanks in Advance

+2  A: 

If you are targeting the Flash Player, you cannot do this. You are only allowed to prompt the user for where to save it.

It does work very nicely, but it may not be what you want.

If you are using AIR, there are other classes available to let you work with files in specific directories. AIR gets around a lot of the security issues because your app is actually installed by a user.

Can you imagine opening a flash file from a website that modifies things on your hard drive without you knowing it? It just isn't allowed unless you use AIR.

The File and FileStream classes will be useful to you if you are going to use AIR 1.0 as your target environment. The File class will let you reference any files, and then FileStream provides methods to read and write to them.

Kekoa
...because who would ever want to overwrite C:\boot.ini? :)
grawity
A: 

Similar discussion here: http://www.experts-exchange.com/Programming/Languages/Scripting/Q_22582130.html

NinethSense
that site you linked to is the devil
TandemAdam