# Download .pdf with FileReference causing errors

**URL:** <https://forum.kirupa.com/t/download-pdf-with-filereference-causing-errors/204860>\
**Category:** Uncategorized\
**Created:** [October 24, 2006, 4:01am UTC](https://forum.kirupa.com/t/download-pdf-with-filereference-causing-errors/204860 "2006-10-24T04:01:06Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ThePuzzleMaster](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/thepuzzlemaster/32/972_2.png) [@ThePuzzleMaster](https://forum.kirupa.com/u/ThePuzzleMaster)\
**Post date:** [October 24, 2006, 4:01am UTC](https://forum.kirupa.com/t/download-pdf-with-filereference-causing-errors/204860/1 "2006-10-24T04:01:06Z")

</div>

Hello,  
I’m trying to set up a button that will download a .pdf file when clicked. I’m using the FileReference.download(url) method, and it returns an error in my browser.

After I select the location I want to download to it says that:  
SHOCKWAVE FLASH  
This plug-in performed an illegal operation. You are strongly advised to restart fireFox.

Does anyone know why this would be or what I can do to fix it?

Thanks,  
iLan

---

<div class="post-metadata">

**Author:** ![ThePuzzleMaster](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/thepuzzlemaster/32/972_2.png) [@ThePuzzleMaster](https://forum.kirupa.com/u/ThePuzzleMaster)\
**Post date:** [October 24, 2006, 4:09am UTC](https://forum.kirupa.com/t/download-pdf-with-filereference-causing-errors/204860/2 "2006-10-24T04:09:10Z")

</div>

So, after a restart of my computer, I don’t get the error message, but it doesn’t ever seem to start the download?

---

<div class="post-metadata">

**Author:** ![ThePuzzleMaster](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/thepuzzlemaster/32/972_2.png) [@ThePuzzleMaster](https://forum.kirupa.com/u/ThePuzzleMaster)\
**Post date:** [October 25, 2006, 7:58am UTC](https://forum.kirupa.com/t/download-pdf-with-filereference-causing-errors/204860/3 "2006-10-25T07:58:11Z")

</div>

Does anyone know what might be causing it to look like it’s going to downlaod but never actually download? I imported the FileReference class, so that’s not it…

It just brings up the dialog box asking where to save it, but then when I click ok, the dialog box goes away and nothing else ever happens…

---

<div class="post-metadata">

**Author:** ![Rasper](https://avatars.discourse-cdn.com/v4/letter/r/9fc29f/32.png) [@Rasper](https://forum.kirupa.com/u/Rasper)\
**Post date:** [October 25, 2006, 9:52am UTC](https://forum.kirupa.com/t/download-pdf-with-filereference-causing-errors/204860/4 "2006-10-25T09:52:00Z")

</div>

I don’t think kirupians can smell code, we have to be able to see it. Or did you just use the same basic code that’s in the help?

---

<div class="post-metadata">

**Author:** ![ThePuzzleMaster](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/thepuzzlemaster/32/972_2.png) [@ThePuzzleMaster](https://forum.kirupa.com/u/ThePuzzleMaster)\
**Post date:** [October 25, 2006, 7:57pm UTC](https://forum.kirupa.com/t/download-pdf-with-filereference-causing-errors/204860/5 "2006-10-25T19:57:52Z")

</div>

Okay. Valid point… Well let’s keep things simple. I used this code

```auto

var myFileRef:FileReference= new FileReference
myBtn.onPress=function(){
        myFileRef.download("http://www.mysite.com/sampledoc.pdf")
}

```

The file definitely existed… I think I’ll make a sample.fla to post and see if that can help…

---

<div class="post-metadata">

**Author:** ![Rasper](https://avatars.discourse-cdn.com/v4/letter/r/9fc29f/32.png) [@Rasper](https://forum.kirupa.com/u/Rasper)\
**Post date:** [October 26, 2006, 1:02am UTC](https://forum.kirupa.com/t/download-pdf-with-filereference-causing-errors/204860/6 "2006-10-26T01:02:46Z")

</div>

Very odd. I tried it myself and it doesn’t work either for me :cyclops:

I’ve worked with the filereference class before to upload files, but never to dowload files.

I found an article on [adobe.com](http://adobe.com) that talks about the same problem, but it mentions the Flash Player 9. [http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=3637d5c3](http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=3637d5c3)

I’d like to know what’s the problem too now.
