You will need to use the HttpService to place the data on the page of your website. When I did this, I sent the image data as a Base64 encoded string to a PHP page that used the GD library to save it to a png file on the server. Here is a simplified example of how my code looked
Flex Code
public function saveImg():void{
var bd:BitmapData = new BitmapData(mycanvas.width,mycanvas.height);
bd.draw(mycanvas);
var ba:ByteArray = PNGEncoder.encode(bd);
var encoded:String = Base64.encodeByteArray(ba);
var objSend:Object = new Object;
objSend.data = encoded;
objSend.filename = _imgResult;
writeImage.send(objSend);
}
<mx:HTTPService id="writeImage" url="/saveImage.php" method="POST" resultFormat="text" result="resultHandler(event)"/>
PHP File (saveImage.php)
<?php
if (isset($_POST["data"]) && ($_POST["data"] !="")){
$data = $_POST["data"];
$data = base64_decode($data);
$im = imagecreatefromstring($data);
}
$filename = "test"
if (isset($im) && $im != false) {
$imgFile = "/etc/www/html/".$filename.".png";
if(file_exists($imgFile)){
unlink($imgFile);
}
$result = imagepng($im, $imgFile);
imagedestroy($im);
echo "/".$filename.".png";
}
else {
echo 'Error';
}
?>
Base64Encode dynamicflash, , flex, . php config , GD, .
, , .