I'm new to Flex and couldn't figure out yet how to send binary data to the server as the body of a POST request. The HTTPService component doesn't seem to support this. The FileReference doesn't seem to support setting the data via the Flex API.
Unfortunately the answers to similar questions on stackoverflow.com haven't been very promising. Any new pointers would be greatly appreciated, thanks a lot!
-- Andreas
Depending on your goal, you may want to consider using AMF objects. google "flex actionscript" that assumes that you control the server. Zend AMF is a pretty good PHP AMF implementation.
Post it using the
URLLoader
andURLRequest
classes.I've never used Flex but I would imagine you would need to encode your binary data in ascii using something like http://en.wikipedia.org/wiki/Uuencoding
It's true, Flex's HTTPService does not support different enctypes. A good alternative I found and use is ru.inspirit.net.MultipartURLLoader found at http://code.google.com/p/in-spirit/source/browse/#svn/trunk/projects/MultipartURLLoader/ru/inspirit/net (MIT License). Works well! :)