views:

1421

answers:

4

I'm having problems sending a ByteArray over to my Zend_Amf_server. I get a NetConnection.Bad.Call back from the server. If I send a variable with another datatype then ByteArray it works fine.

I used the same script before with AMFPHP witouth any problems. But for this project I really need this to work in Zend_Amf.

AS3:

var path:String = "/images/picture.jpg";
var ba:ByteArray = jpgencoder.encode(bitmap.bitmapData);

var nc:NetConnection = new NetConnection();
nc.connect(zend_amf_server);

nc.call("Service.saveJPG", new Responder(responseHandler, errorHandler), path, ba);

PHP:

class Service{
    public function saveJPG($path, $byteArray){
             return "worked";
    }
}
+1  A: 
David Ortinau
A: 

Thanks David for your reply, the problem seemed to be that I sent a ByteArray to Zend_Amf together with a String. If I send the ByteArray only it works fine and the Image is saved.

The only problem now is that the path to save the image on should be variable and I can't send it over to my Amf_Server together with the ByteArray at the same time.

A: 

Ok, I found the problem. I was using the Zend Framework in the latest 'tag' repository v. 1.7.5 I switched the repository for AMF to the the 'trunk' repository and now it works. There was a bug in Zend_Amf_Server when sending Arrays over to it.

yens resmann
A: 

This is not working for me...