I want to download a file in flex. Here is my desired flow
- User clicks "view"
- Code goes to backend and get the file as an array of bytes
- bytes sent from java to flex via a callback
- flex then opens dialog and user decides where to save the file
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
- User clicks "view"
- Flex shows user the dialog and user chooses where to save file
- Flex goes to backend requesting bytes of file
- bytes sent to flex and data is saved.
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