# fileReference.download

**URL:** <https://forum.kirupa.com/t/filereference-download/246169>\
**Category:** flash\
**Created:** [December 7, 2007, 6:04pm UTC](https://forum.kirupa.com/t/filereference-download/246169 "2007-12-07T18:04:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![daidai](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/daidai/32/3087_2.png) [@daidai](https://forum.kirupa.com/u/daidai)\
**Post date:** [December 7, 2007, 6:04pm UTC](https://forum.kirupa.com/t/filereference-download/246169/1 "2007-12-07T18:04:25Z")

</div>

when i click. the save window opens but the image is not saved, what am I doing wrong? i have uploaded it to a test server by the way and it still doesnt work…

```auto
var myImgURL:String = 'http://www.mysite.com/images/image1.jpg';

```

```auto
fileDwnld.addEventListener(MouseEvent.CLICK, function down (evt:Event) {                
                    var fileReference:FileReference = new FileReference( );
                    var urlRequest:URLRequest = new URLRequest(imgURL);
                    fileReference.download(urlRequest);
                });    

```
