php - Is there any way to receive an image file through Flex's HttpService? -


i've written piece of code use php script send data flex.

here's flex code:

<s:httpservice id="imageservice" url="http://localhost/bookview/amfphp/services/imageserver/showimage.php"                     useproxy="false"                     method="post"                    result="handleimageresult(event)"                     fault="handlefault(event)"                     showbusycursor="true">         <s:request xmlns="">             <bdla>"lashf"</bdla>         </s:request>     </s:httpservice> 

here's php code:

        public function returnrandomimage(){             $contents = file_get_contents("images/code_complete2.png");             header('content-type: image/png');              return $contents;         } 

thing is: i'm interested in using php send image file, render , use in flex. however, when .send() httpservice, fault event message: (i've tried both with header() function , without it).

(mx.messaging.messages::acknowledgemessage)#0  body = "png" 

that's it. hope can help. if there no way use httpservice end (i.e. send image files), how can 1 then? i've seen in app worked on i'm positive can done.

edit added php code too.

you can encode image using base64, way can send , receive text.

http://www.google.es/search?sourceid=chrome&ie=utf-8&q=as3+base64+encoder


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -