views:

48

answers:

1

I'm generating a PNG file in Flex from graphics drawn by user. I would like to send the file to Ruby on Rails backend and I'm using RubyAMF in other parts of the application.

I found ways to upload the file using FileReference which uses HTTP but I prefer to send using RubyAMF ,if possible, as it's more efficient.

If this is possible what is your suggested method?

+1  A: 

Transferring image data such as png is not more efficient using AMF than plain old HTTP. Indeed, AMF itself sits on top of HTTP (in this context) so is another layer to go through before accessing the image data.

If you really want to use AMF to transfer binary data (and I strongly suggest you don't) then there is the ByteArray type. RubyAMF appears to support this type.

Also check this answer on how to convert this data in flash.

njoyce
Thanks. I ended up going with your suggestion of using HTTP to handle the upload
Tam