I want to download a file in flex. Here is my desired flow
Unfortunately the last part is not on a user event but on the callback from the server. When I call new FileReference().save(...) it tells me this.
An alternative could be
For this approach I am unsure how I can make the save asynchronous from the dialog.
Does anyone have any ideas on how I can approach this? Basically I want the user to save a file but the data but come from an array of bytes from the backend
Thanks
FileReference.save() method is not used when you want to save the result.. this method is called only when the mouse or keyboard event occurs. so my advice to you that don't use this method. You can use that method in other way like save the file using JAVA in on back end side. and the method will return you the path of that. you just need to create a URLRequest and call the navigateToURL method. as i have given below.
var path:String = e.result.toString();
var urlRequest:URLRequest = new URLRequest(path);
navigateToURL(urlRequest,"_blank");
Have a Nice Day....