# Force Download

**URL:** <https://forum.kirupa.com/t/force-download/311986>\
**Category:** flash\
**Created:** [July 21, 2010, 9:51pm UTC](https://forum.kirupa.com/t/force-download/311986 "2010-07-21T21:51:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![olirushworth](https://avatars.discourse-cdn.com/v4/letter/o/97f17d/32.png) [@olirushworth](https://forum.kirupa.com/u/olirushworth)\
**Post date:** [July 21, 2010, 9:51pm UTC](https://forum.kirupa.com/t/force-download/311986/1 "2010-07-21T21:51:40Z")

</div>

Hi guys,

I’m having a bit of trouble with creating a download link.

Basically on my flash website I have a PDF of my portfolio which is available to download, I don’t want people to view it in the browser because I’d like to them to have it on their desktop so they can view it offline, etc

So far I have;

pdfbtn\_over.addEventListener(MouseEvent.CLICK,goPDF);

import flash.net.FileReference;

var myPDF = “[http://www.olirushworth.co.uk/OliRushworthPortfolio.pdf](http://www.olirushworth.co.uk/OliRushworthPortfolio.pdf)”;

var fileRef:FileReference = new FileReference();

```
function goPDF(e:MouseEvent):void{
	fileRef.download(myPDF, 'OliRushworthPortfolio.pdf')

```

}

I got like the tutorial from ;  
[http://www.blog.lessrain.com/flash-f…ks-in-flash-8/](http://www.blog.lessrain.com/flash-force-download-no-more-dirty-tricks-in-flash-8/)

any help would be fantastic as this is one of the last things to do before my site goes live, thanks ![](http://forum.kirupa.com/uploads/kirupa/6091/7e75d376426c6c37.gif)
