With FileReference it is impossible, I guess for safety reason (not allow a web application to create file somewhere on the filesystem on the background).
Thanks for the response. Yes I do understand the security aspect and I wouldn't want to fully allow web interaction with desktop , however , in this case Flex is already acessing the users desktop by allowing the user to select the local directory manually, I just want to automate that process essentially, by specifying the user's path programatically....
You have to stick with the default browser behaviour => opening a dialog box
I checked on many browers and Flex bypass the default behaviour of the browser (I set up the "don't ask where to save the file" option)...
it does matter what runtime is used: if you are using Flash runtime (web hosted, standalone player) then you won't have access to local filesystem without user interaction (including requirement for user triggered event to start some processes). That's part of Flash runtime security pragma. To be able to use Flash runtime (Flash plugin) based movie you would require to wrap that content with 3rd party tools that overcome that limitations.
If you would use AIR runtime then you would have access to additional api (namely: flash.filesystem.File) that would allow you to achieve silent download without user interaction (as your end user had already installed application within its machine local sandbox, correct?)
There is also conceptual difference between runtimes and apis:
in Flash runtime when using FileReference you do not care about some low level details - with cost that user have to select where content is to be saved.
in AIR runtime (and in 3rd party tools) you would care about more details: for example to download file silently with AIR SDK (flash.filesystem.File) you would possible use FileStream class to start writing data locally as data arrives via URLStream (so file is downloaded asynchronously and operation is not blocking, etc). See:
You could still use FileReference in AIR based runtime if that is OK for you to let user decide where to store content.
Thanks Peter, I'm aware of the differences between AIR and web based flash. What
3rd party tools are you referring to?