meWantToLearn
meWantToLearn

Reputation: 1700

cannot decode AMF encode messages from flash PHP

I am receiving encoded data from flash in AMF format, but I want to decode it in php .

I do not know how can I use the library https://github.com/silexlabs/amfphp-2.0/blob/master/Amfphp/Core/Amf/Serializer.php

I cant find a sample code that instructs how to do a simple decode of AMF encoded message

Upvotes: 2

Views: 1061

Answers (4)

Eugeny89
Eugeny89

Reputation: 3741

Have a look at nekoserver project. It's simplified analogue of amfphp written in Haxe. There you can find nekoserver.amf.io package, look at AmfDeserializer.hx (reading metadata) and Amf3Reader.hx (reading message body). It's all very simple there. Well, I guess the fact that project is written in Haxe is not vey good for you, but you should not be affraid syntax of Haxe is very similar to Actionscript syntax.

Also I recomend to look at AMF format specification.

PS. Did I understood correctly that you need AMF3 (not AMF0)?

Upvotes: 0

neoxic
neoxic

Reputation: 565

Take a look at a very reliable PHP extension for encoding/decoding AMF3 streams without the overhead of using pure PHP encoders/decoders - https://github.com/neoxic/php-amf3

Upvotes: 0

Imran Haider
Imran Haider

Reputation: 21

I had the same problem once, and solved it as follows.

You can use javascript base64 encoding inside Flash while you can use base64_decode function in PHP. I have used before and it works perfectly.

Upvotes: 1

user797257
user797257

Reputation:

I would advise against using Zend_Amf, it was written with some mysterious misconception in mind, which they consider to be the "architecture"... AMFPHP still exists and is maintained by some folks who didn't like Zend that much http://sourceforge.net/projects/amfphp/

Here is their site with examples and explanation on how to set it up etc: http://www.silexlabs.org/amfphp/

Upvotes: 2

Related Questions