Re: [flexcoders] Posting PNG to server
we got it working now, thanks for help anyway :) On 1/25/07, franto [EMAIL PROTECTED] wrote: what do ou mean exactly? On 1/25/07, Simeon Bateman [EMAIL PROTECTED] wrote: I have done this with ColdFusion using the RemoteObject tag. Can you use one of the remote object php tools to pass the binary data? simeon On 1/25/07, franto [EMAIL PROTECTED] wrote: Hi, Please help me, how can I post PNG (ByteArray created by Tini Uro's convertor) to server (PHP) Im try URLLoader + URLRequest.data = png but it doesnt work :( Does anyone know, what should I do? Thanks P.S. Close to deadline :)) Franto -- - Franto http://blog.franto.com http://www.flashcoders.sk -- - Franto http://blog.franto.com http://www.flashcoders.sk
RE: [flexcoders] Posting PNG to server
If you are using AMF3 (RemoteObject), you can serialize binary data without any conversion. If you are trying a standard HTTP post, I would use a HTTPService with the method= POST. Then you have to Base64 encode the binary data and attach it to the parameters of the http service. On the server side, you will need to decode the base64 encoded data back into binary. Example: mx:HTTPService id=httpService showBusyCursor=true useProxy=false method=POST resultFormat=text url=/BinaryData/cf/HTTPImageSave.cfm result=onResult('Data Saved via mx:HTTPService') fault=onFault(event) / private function base64Encode( data : ByteArray ) : String { var encoder : Base64Encoder = new Base64Encoder(); encoder.encodeBytes( data ); return encoder.flush(); } private function sendData() : void { var data : ByteArray = encoder.encode( myPngByteArray ); var params : Object = { data : base64Encode( data ) }; httpService.send( params ); } In ColdFusion, you can decode the base64 data simply by using the toBinary function. Other languages have similar functions as well. Just a FYI... using the JPG instead of PNG requires significantly less bandwidth time to post the data to the server. Base64 encoding the data also increases the size of the data being transferred across the wire. It is much more efficient to use a remoteObject method with JPG-compressed data. -Andy _ Andrew Trice Cynergy Systems, Inc. http://www.cynergysystems.com Blog: http://www.cynergysystems.com/blogs/page/andrewtrice Email: [EMAIL PROTECTED] Office: 866-CYNERGY From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Simeon Bateman Sent: Thursday, January 25, 2007 2:20 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Posting PNG to server I have done this with ColdFusion using the RemoteObject tag. Can you use one of the remote object php tools to pass the binary data? simeon On 1/25/07, franto [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Hi, Please help me, how can I post PNG (ByteArray created by Tini Uro's convertor) to server (PHP) Im try URLLoader + URLRequest.data = png but it doesnt work :( Does anyone know, what should I do? Thanks P.S. Close to deadline :)) Franto
Re: [flexcoders] Posting PNG to server
I have done this with ColdFusion using the RemoteObject tag. Can you use one of the remote object php tools to pass the binary data? simeon On 1/25/07, franto [EMAIL PROTECTED] wrote: Hi, Please help me, how can I post PNG (ByteArray created by Tini Uro's convertor) to server (PHP) Im try URLLoader + URLRequest.data = png but it doesnt work :( Does anyone know, what should I do? Thanks P.S. Close to deadline :)) Franto
Re: [flexcoders] Posting PNG to server
what do ou mean exactly? On 1/25/07, Simeon Bateman [EMAIL PROTECTED] wrote: I have done this with ColdFusion using the RemoteObject tag. Can you use one of the remote object php tools to pass the binary data? simeon On 1/25/07, franto [EMAIL PROTECTED] wrote: Hi, Please help me, how can I post PNG (ByteArray created by Tini Uro's convertor) to server (PHP) Im try URLLoader + URLRequest.data = png but it doesnt work :( Does anyone know, what should I do? Thanks P.S. Close to deadline :)) Franto -- - Franto http://blog.franto.com http://www.flashcoders.sk
Re: [flexcoders] Posting PNG to server
Franto, I posted a reply on your question today in the other thread ; )
Re: [flexcoders] Posting PNG to server
1 more thing can be sent in 1 URLRequest post data + PNG i think its not possible, but just asking because for png i need to set request.contentType = multipart/form-data; but it removes ll POST vars (text) is it possible to merge these 2 kinds of data? Franto On 1/25/07, franto [EMAIL PROTECTED] wrote: we got it working now, thanks for help anyway :) On 1/25/07, franto [EMAIL PROTECTED] wrote: what do ou mean exactly? On 1/25/07, Simeon Bateman [EMAIL PROTECTED] wrote: I have done this with ColdFusion using the RemoteObject tag. Can you use one of the remote object php tools to pass the binary data? simeon On 1/25/07, franto [EMAIL PROTECTED] wrote: Hi, Please help me, how can I post PNG (ByteArray created by Tini Uro's convertor) to server (PHP) Im try URLLoader + URLRequest.data = png but it doesnt work :( Does anyone know, what should I do? Thanks P.S. Close to deadline :)) Franto -- - Franto http://blog.franto.com http://www.flashcoders.sk -- - Franto http://blog.franto.com http://www.flashcoders.sk -- - Franto http://blog.franto.com http://www.flashcoders.sk