Flash Player can send images to web services like Amazon AWS. The built-in behavior requires the user to browse to an image on the user’s system using a system dialog to select the image for sending. It is possible to send an image from Flash Player without requiring the use of a system dialog to locate the image file, and even without the requirement of saving the image to the system before sending it! In fact, images can be sent without any user interaction whatsoever.
In a recent application we developed, we deployed a solution for capturing BitmapData of a playing video and sent the image to Amazon AWS. The thumbnail could be retrieved later for populating a display of the user’s video bookmarks.
- Capture a BitmapData object of something being displayed in a SWF – any display object
- Convert it to JPG. Several methods are available, we used: https://github.com/LeeBurrows/Async-Image-Encoders
- Using HTTP POST, send the image to Amazon (or anywhere) for storage. This is the difficult part. We derived our solution from Open Booth: https://github.com/obsesh/openbooth/
… which was in turn based on the work of Joa Ebert.
The technique employed writes the necessary headers to the HTTP Post call so that no PHP intermediary is required to send captured image data directly from Flash Player.
Here’s a direct link to the relevant HTTP Post class in Open Booth: