Generating an image, saving to hard drive

I’m working on an interactive kiosk application for a children’s museum, and have been having a hell of a time getting this last and final piece working. I created a feature in my main kiosk application (written entirely in AS3) that lets a user take an image from a webcam stream, then fill in some basic information and (attempt to) send an e-mail. The e-mail will b a “postcard” from the kid to their parents, through the kiosk.

I am able to capture and pass the webcam image just fine off to an external (but local) PHP script, but no matter how I try it, I can’t get PHP to generate the image to a jpeg without a prompt.

This PHP script uses PHPMailer to send an e-mail, and my hope was to attached an external image to the PHPMailer e-mail using AddEmbeddedImage. However, I am having a very hard time getting PHP to create the image silently so that the script can just point to it on the hard drive and attach it.

I have tried:

  1. A separate PHP script that takes the encoded ByteArray from AS3, sets up headers to be a “jpeg” and then echos the bytearray.
  2. fopen, fwrite, fclose to make the image

I need this solution to be completely transparent to the user and not require any user input for file locations. However, each method prompts the user to save a file somewhere, which will confuse any user of the kiosk.

I am in desperate need of a solution, I’ve been working on this for far too long! Thanks!