views:

386

answers:

2

I need something like FileStream class in Adobe AIR, but needs to work in Flash Player. I know there is FileReference#save(), but it can only save the whole file at once, which does not work if the size of the data to be saved is larger than the available memory... Is it really not possible to stream data to a local file to avoid keeping the whole data in the memory? Or maybe it is possible to append data to a local file without first reading the whole file into memory?

I need this badly! Thanks!

+1  A: 

You're out of luck. Security restrictions don't allow this to happen outside the context of an AIR application.

Matt W
A: 

If you have a server to hit you could sort of do it by passing the data through the server.

Use FileReference.save() and hit some URL on your server. Then, start streaming the data you want saved to the server, and then have the server just redirect that to the flash client. You'll need to write some custom handling of things on the server, and it won't be nearly as fast as just saving locally, but it's probably the only way you'll be able to do it.

Herms