views:

36

answers:

2

I need the user of my Flex application to be able to save a snapshot of part of the UI to a local jpg file. I got the screenshot part down - can generate an image out of any given control. However, the only way I see to let the user save the image locally is to send to my server which would return it with the appropriate Content-Disposition.

I really hope I can avoid this silly round-trip to the server. Any ideas?

+1  A: 

If you want to reuse the jpg file in your Flex application you could save it as Flash Cookie via SharedObject to the local filesystem and restore it later. In this case you must be aware of the Flash Cookie size limit which is typically set to 100KB.

splash
+2  A: 

You can avoid this round trip if you are targeting only Flash player 10. The FileReference class FP10 has a save method that lets you save a file to local machine; of course you still need the user's confirmation to do it.

Amarghosh
I do target Flash 10 (Flex 4). I'll try this, thanks.
Assaf Lavie
This was new to me. I will also try this. :-)
splash