I can't use remote object in Flex to save an image to the server.
I have a situation where I can't use remote object in Flex to save an image to the server.
Could someone help me with an alterntaive?
private function doSave():void {
var bd:BitmapData = new BitmapData(canvas.width,canvas.height);
var pe:PNGEncoder = new PNGEncoder;
bd.draw(canvas);
var ba:ByteArray = pe.encode(bd);
myService.doUpload(ba,sIP);
}
<cffunction name="doUpload" displayname="Save Signature" hint="Saves a PNG Signature" access="remote" output="false" returntype="any">
<cfargument name="sigbytes" required="true" type="binary">
<cfargument name="ip_suffix" required="true" type="string">
<cfset myUUID = RandomString('ABCDEFGHIJKLMNOPQRSTUVWXYZ',15)>
<cfset name = expandPath("converted_pngs/signature_#arguments.ip_suffix#_#myUUID#.png")>
<cffile action="write" file="#name#" output="#arguments.sigbytes#" />
<cfset SigFileName = "#arguments.ip_suffix#_#myUUID#">
<cfreturn SigFileName />
</cffunction>
