File downloads and http headers.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
RFairey
Forum Commoner
Posts: 52
Joined: Fri Jun 06, 2003 5:23 pm

File downloads and http headers.

Post by RFairey »

I have a bunch of .zip files that I want people to be able to download if they have logged in. The files are chmodded to 700 so that my script can read them, but no one can request the files directly through the URL.

I have the logins working fine, but the download script behaves very differently in different browsers, i'm not even sure it works at all.

In IE6, the HTML file is downloaded instead,
In N7, .php is appended to the .zip extension
In Opera, the filename is correct, but the received file is corrupted.

What is the tried and tested way (if any) to do this?
jmarcv
Forum Contributor
Posts: 131
Joined: Tue Jul 29, 2003 7:17 pm
Location: Colorado

Post by jmarcv »

How are you doing it now?
You could copy the file to the tmp folder, make a link to it, and optionally put instructions on page to right-click link and choose 'save file'.
Post Reply