Click to See Complete Forum and Search --> : Creating a Downloadable PDF File


MichaelW
03-25-2003, 12:17 PM
First, I am a beginner and do not know HTML or other code.

I used MS Publisher to create a basic web page, and I have it published.

I have a PDF document which I want to put on my site such that visitors will be able to click on a link and it will DOWNLOAD to them, rather than opening the PDF document on the screeen.

How do I do this ? I appreciate any help you can give. Thanks.

Michael

pyro
03-25-2003, 12:23 PM
You will need to use a server side language. This page shows how to do it with PHP:

http://www.infinitypages.com/research/download.htm

MichaelW
03-25-2003, 12:41 PM
Pyro,

Thanks for the link. As I said in my post, I really don't know programming, so could you give me some more guidance ?

As I understand what you sent, I need to place the following link (with my file name), on the web page of my site:

<a href="filedownload.php?filename=file.ext">

I assume I just use the process of "insert" "hyperlink" to do this ?

But what do i do with the rest ? (the filedownload.php and following block of code) Do I create a php file named "filedownload.php ? If so, how do I create a php file ? Just use text editor ?

Sorry to be so clueless on this; I need real simple instructions being so new at this. I appreciate any further help you can give. Thanks.

Michael

Pixelchik
03-25-2003, 01:02 PM
Michael,
What you could do is just zip the PDf file using WinZip or PKZip (or any Zip utility). I do this for my company's website. Zip files will just download to the user.

pyro
03-25-2003, 01:04 PM
Yes, that is how you need to link to the files you are going to be downloading. For the PHP file, you can just copy the code out of my page (in the filedownload.php block) and paste it into notepad. Now, save the file as filedownload.php. You will want to upload this to the same dirctory as the files you are going to be downloading from. Please let me know if you need more help on this.

MichaelW
03-25-2003, 01:44 PM
Pyro & PixelChik,

Thanks SO MUCH for your help.

I tried the zip file as PixelChik suggested, since it was faster and easier for me to do. It worked perfectly !

Pyro, I intend to try your approach again. I created the php file and posted it. However, the first time I tried it out, it didn't work.

In MS Publisher, I inserted the link exactly as you had it:

<a href="filedownload.php?filename=file.ext">

I'm wondering if I was wrong in using the "<" and ">" symbols on each end of the string ? If you could let me know back, I'd appreciate it.

Thanks again to BOTH of you for your help !!!

Michael

nonJAVAperson
08-12-2004, 12:18 PM
Does .PHP scripting need to be turned on within the server for this to work? I have the files test.txt, test2.txt, filedownload.php, and download.htm on my website and intranet site. They work great out on the web, but not on the intranet running WinServ2003 with IIS6. Is .PHP server specific?

Exuro
08-12-2004, 12:32 PM
Yes, you need to have PHP installed on your web server in order to run PHP scripts. I linked to an article in your other thread (http://www.webdeveloper.com/forum/showthread.php?s=&threadid=41625) which explains how to install PHP on IIS.