File uploads with Adobe Flex and Zend AMF

      Comments Off on File uploads with Adobe Flex and Zend AMF

Zend AMF is a PHP implementation of the AMF (Action Message Format) binary protocol within the ZendFramework. I had to implement a system to upload files that were a little different than what is typically used in Flash, so I built upon Zend AMF for my needs.

Researching a little on the net, I found a solution that was simpler than I expected. Based on an article, I only had to make a few adjustments.

Begin with our gateway to be used as endpoint in Adobe Flex.

First VO properties with the file name and binaries.

Now our PHP class to process the uploading:

Now we add the view layer using Adobe Flex, starting with our VO:

Now our mxml that will load the bytes from the file to send to Zend AMF for encoding and transfer. Explore the full source code on my site.

My blog: http://www.leonardofranca.com