Código ActionScript :
function sendData(pixels:Array, h:Number, w:Number) { //Create the LoadVars object and pass data to PHP script var output:LoadVars = new LoadVars(); output.img = pixels.toString(); output.height = h; output.width = w; output.nombre = nombre_txt.text ; trace(nombre); //The page (and this movie itself) should be in a server to work output.send("show.php","output","POST"); }
Código PHP :
header( "Content-type: image/jpeg"); ImageJPEG( $image, "mi_camiseta.jpg" ); $nombre = $_POST ['nombre']; $prefijo = substr(md5(uniqid(rand())),0,6); $imageup = file_get_contents("mi_camiseta.jpg"); file_put_contents("files_pedidos/".$nombre.$prefijo."micamiseta.jpg", $imageup); imagedestroy( $image );