Page 1 of 1

Setting up files for download on my PHP site

Posted: Wed Sep 15, 2004 9:16 am
by frankpmjr
Hi,

I can't seem to find how to code my pages to allow users to download files from my site. Please tell me where to find this information or what the code is. I have been looking through all of my PHP books and can't find it anywhere. It seems like it should be very simple but I am stumped, thanks for the help.

Posted: Wed Sep 15, 2004 9:20 am
by MarK (CZ)
You don't have to code anything, just put there a direct link to the file. If it fails, you probably have to set up correct rights to those files (so that they're accessible by users) with some FTP manager.

a little more

Posted: Wed Sep 15, 2004 9:27 am
by phpScott
for ex

Code: Select all

<a href="myfile.zip">my file dot zip</a>
the browser should be smart enough to realize that you want to download the files.
Of course it could depend a little on your server configuration but it shouldn't be an issue.

phpscott

Posted: Wed Sep 15, 2004 9:29 am
by frankpmjr
Well don't I feel like an idiot. I can't believe it was that simple. I actually tried that but just realized that I misspelled the file name. Thank you very much, I appreciate it.

it happens to all of us

Posted: Wed Sep 15, 2004 10:55 am
by phpScott
It happens to all of us.
I just spent 15 mins trying to figure out why something wan't printing only to realize I had put the print statement after my return statement
do'h