# Send xml to Flex app with AMF

**URL:** <https://forum.kirupa.com/t/send-xml-to-flex-app-with-amf/314017>\
**Category:** flash\
**Created:** [September 16, 2010, 7:32am UTC](https://forum.kirupa.com/t/send-xml-to-flex-app-with-amf/314017 "2010-09-16T07:32:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![yung](https://avatars.discourse-cdn.com/v4/letter/y/edb3f5/32.png) [@yung](https://forum.kirupa.com/u/yung)\
**Post date:** [September 16, 2010, 7:32am UTC](https://forum.kirupa.com/t/send-xml-to-flex-app-with-amf/314017/1 "2010-09-16T07:32:48Z")

</div>

Hi!, we need to send a XML file to our Flex client, and we decided to do with AMF instead of URLLoader/URLRequest because with these functions the xml file is stored in the “Temp” folder of th browser, and for security reasons we don´t want this.

I have installed AMFPHP in the server, and created a service with this simlpe code:

```php

function recibe($sMessage)
    {
        $archivo = "playlist.xml";
        $fp = fopen($archivo, "r");
        $contents = fread($fp, filesize($archivo));
        return $contents;
    }

```

but I think that this is not an efficient way to send the data in the .xml file, and in the test I made, the time of send all the data (playlist.xml size is about 700kb) is the same than send via URLLoader/URLRequest…

It´s the first time that I work with AMF, **can you tell me any tip or suggestion to send the entire structure of a xml file?**

and lastly,\*\* there is any way to compress the data that the service send to Flex client? \*\*  
THANKS!
