# Downloading A Pdf Within A Flash Movie

**URL:** https://forum.kirupa.com/t/downloading-a-pdf-within-a-flash-movie/42159
**Category:** flash
**Created:** [February 5, 2004, 9:44pm UTC](https://forum.kirupa.com/t/downloading-a-pdf-within-a-flash-movie/42159 "2004-02-05T21:44:52Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![eltondelux](https://avatars.discourse-cdn.com/v4/letter/e/ce7236/32.png) [@eltondelux](https://forum.kirupa.com/u/eltondelux)
#### Post date: [February 5, 2004, 9:44pm UTC](https://forum.kirupa.com/t/downloading-a-pdf-within-a-flash-movie/42159/1 "2004-02-05T21:44:52Z")

</div>

I am trying to figure out how to offer a downloadable pdf from a flash movie i have made. I’ve made the button for it but I can’t understand how to reference the file with actionscript to get the pdf from my server and download it to their computer. Any one have a quick solution?

Thanks

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 5, 2004, 10:39pm UTC](https://forum.kirupa.com/t/downloading-a-pdf-within-a-flash-movie/42159/2 "2004-02-05T22:39:46Z")

</div>

```auto

on (release) {getURL("yourfile.pdf");

```

TD

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 6, 2004, 8:40am UTC](https://forum.kirupa.com/t/downloading-a-pdf-within-a-flash-movie/42159/3 "2004-02-06T08:40:53Z")

</div>

This might work, but also might not if the user has the acrobat browser plug-in installed; in that case, it would open in the browser!  
(of course, the user can then still hit the “save” button, but your page will be history -literally, user’ll have to hit “back”…)  
Best way is to zip it.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 6, 2004, 6:53pm UTC](https://forum.kirupa.com/t/downloading-a-pdf-within-a-flash-movie/42159/4 "2004-02-06T18:53:55Z")

</div>

But some people (XP users for example) have it so that ZIP files are being automatically opened :-/

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 8, 2004, 10:29pm UTC](https://forum.kirupa.com/t/downloading-a-pdf-within-a-flash-movie/42159/5 "2004-02-08T22:29:15Z")

</div>

Ok, I’m still learning alot of this so bare with me – The actionscript above says to getURL “yourfile.pdf” but the issue is, the PDF will be on a different location than the flash file on the server for whatever reason. So, how do I tell it to get the file from say [www.mywebsite.com/yourfile.pdf](http://www.mywebsite.com/yourfile.pdf)?  
Or do I just stick that in quotes instead of just the yourfile.pdf like it is written above? And I will probably just zip it to be on the safe side.

I know I’m making this harder than it should be. I guess the main point I don’t get is who it knows where to look for the file unless you have a specific URL or location as to where the external file is.

Thanks for all the help

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 8, 2004, 10:50pm UTC](https://forum.kirupa.com/t/downloading-a-pdf-within-a-flash-movie/42159/6 "2004-02-08T22:50:59Z")

</div>

Flash does not know 🙂  
You gotta tell him/her/it.  
So either as per above,  
if the pdf is in the same folder as the swf;  
or as per your reply, if it’s not,  
getURL(“[http://www.fullpath.com/tofolder/andsubfolder/etc/yourpdfisin.pdf](http://www.fullpath.com/tofolder/andsubfolder/etc/yourpdfisin.pdf)”)  
Why not start by reading the Flash Help files about getURL…?
