I want to upload a file(photo) from Flex to Rails and then send a response back to the server in XML (contains photo URL and ID). I'm sending from my Rails server some XML as follows:
render(:xml => {:id => @photo.id,
:photoURL => @photo.URL,
:thumbPhotoURL => @photo.thumbURL})
This is sent through FileReference object through fileReference.upload()
I try to render it in the complete handler:
fileReference.addEventListener(Event.COMPLETE,function(event:Event):void {
var xml:XML = new XML(event.target.data);
......
it doesn't seem to parse XML properly. I have used similar code before with URLLoader and it worked. Any ideas?