Hello
I have a flash actionscript 3 project that creates a PNG image out of any Flash MovieClip. inside my as3 code i have this code which creates a successful POST to my php script. My question is how do I take the byte array variable and write it to the filesystem as a PNG image.
//prepare data to send to php
var bitmapData:BitmapData = graffitiGalore.drawingTab.main.canvas.drawing(true);
var byteArray:ByteArray = PNGEncoder.encode(bitmapData);
//create a parameters object
var parametersObject:Object = new Object();
//create a POST variable to be sent to php
parametersObject.byte_array = byteArray;
//create a new PHPRequest and pass in the parametersObject
var phpRequest:PHPRequest = new PHPRequest();
phpRequest.makeRequest(ApplicationConstants.SAVE_IMAGE, parametersObject);
phpRequest.addEventListener(Event.COMPLETE, onCompleteSaveImage); );
Ok, so in php i'll have access to $_POST['byte_array'] variable which contains the PNG image byte array as data. How do I take this data and write a real PNG image to the filesystem? I'm new to lots of php stuff still.