# Simple Question: Echo Uploaded Filename

**URL:** https://forum.kirupa.com/t/simple-question-echo-uploaded-filename/233296
**Category:** flash
**Created:** [July 22, 2007, 3:17pm UTC](https://forum.kirupa.com/t/simple-question-echo-uploaded-filename/233296 "2007-07-22T15:17:36Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Blommestein](https://avatars.discourse-cdn.com/v4/letter/b/9d8465/32.png) [@Blommestein](https://forum.kirupa.com/u/Blommestein)
#### Post date: [July 22, 2007, 3:17pm UTC](https://forum.kirupa.com/t/simple-question-echo-uploaded-filename/233296/1 "2007-07-22T15:17:36Z")

</div>

I have a very simple actionscript 3 class, used to upload an .xml file to a php script:

```auto
package {
    import flash.display.*;
    import flash.text.*;
    import flash.events.*;
    import flash.net.*;

    public class loadXML2 {
        //private var uploadURL:URLRequest;
        private var file:FileReference;
        private var _message:TextField;
        
        public function loadXML2() {
            file = new FileReference();
            configureListeners(file);
            var filter:FileFilter = new FileFilter("XML Files", "*.xml");
            file.browse([filter]);
        }

        private function configureListeners(dispatcher:IEventDispatcher):void {
            dispatcher.addEventListener(Event.SELECT, selectHandler);
        }

        private function selectHandler(event:Event):void {
            
            var request:URLRequest = new URLRequest();
            request.url = "load.php";
            request.method = URLRequestMethod.POST;
            
            var file:FileReference = FileReference(event.target);
            file.upload(request);
            navigateToURL( request, "_blank" );
        }
    }
}

```

However I do not know PHP. Could anyone tell me what the script “load.php” should contain to echo out either the name of the uploaded file or its contents?

I’ve tried:

```php
<?php
echo 'Begin';
echo $_FILES['file']['name'];
echo 'End';
?> 

```

and

```php
<?php
$xmldoc = $GLOBALS['HTTP_RAW_POST_DATA'];
echo 'Begin';
echo $xmldoc;
echo file_get_contents("$xmldoc");
echo 'End';
?> 

```

which both only display ‘BeginEnd’, and nothing in between.

Thanks for any help. 🙂
