Skip to main content
nikos101
Inspiring
October 14, 2009
Question

I can't use remote object in Flex to save an image to the server.

  • October 14, 2009
  • 1 reply
  • 1152 views

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>

This topic has been closed for replies.

1 reply

Inspiring
July 26, 2010

Try assigning binary arg to <cfimage/> then save.