Mar 21, 2009

Sending binary from Flash 10 to PHP with Flex 4

Yes I did it I put PHP in the title of a blog post. I'm all about using whats best for the job at hand and if that means your using PHP then so be it. I'm currently re-writing a section of our app in both C# and Groovy just to keep my skills upto date but more of that in another post ;)

The topic of this post is to answer a comment to my Loading binary data in the Flash player client side post. Dave asked "How can I upload this to the server after modifying it if I'm not using ColdFusion? I don't understand what you're doing with the RemoteObject object."

Initially I though it would be easy as per my reply. And well it actually was just that easy. I needed a base64 encoding class and a simple PHP script to accept and base64 decode the data and write it to a file. Thanks to Thomas Stiegler who whipped up this quick script.



Here is a working demo with view source enabled: http://code.kukiel.net/blog/phpresize

You still need Flash 10 and it still only works on Windows but it will post to any server side language you have access to. I'll assume the same could be done over WebOrb for PHP, ( c# ect ) using amf or webservices.

6 comments:

  1. PHP is dead, time to move on.
    ReplyDelete
  2. Well I am a Coldfusion programmer so you don't need to convince me ;)
    ReplyDelete
  3. If you want a technology that is going nowhere, go with SilverLight
    ReplyDelete
  4. Thanks for given this informative post...
    ReplyDelete
  5. Without articulating why you believe PHP is dead, it supports the view that you are simply an embittered novice who had trouble performing some task and gave up.
    ReplyDelete
  6. @Anonymous Hmm I work with both. I did not say PHP was dead. Both have there uses. Personally I find ColdFusion works with less effort with Flex.
    This is why I demonstrated how to use PHP aswell as Flex as I have done so in other demos. I'm also always willing to take advice on how to do somehting better/easier in an alternate language.
    ReplyDelete