downloading files
| From: | Bill Rausch | Date: | Thu, 08 Jun 2000 22:12:24 +0000 |
| Subject: | downloading files | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-1337@lists.php.net to get a copy of this message | ||
I've only been playing with Apache/PHP for a couple of weeks so have mercy
if this is a dumb question.
I'm providing a browsable frontend to a data archiving system to allow
users to retrieve files from an off-line storage system. At the
interesting point in the transaction, the user selects a file by clicking
on its name to execute a link that looks like:
http://hostname/getfile.php?someinfo?filename.
I've written the getfile.php script to get the file from the backend to the
web server machine, and then hand it to the browser using:
... // get file from backend into tmp directory on web server
...
header( "Location: http://hostname/tmp/$filename" );
The question I have is how can I control the downloaded file's name.
Instead of being named, for example, demo.ppt, it is saved by the client's
browser as getfile.php.
Is there a completely better way to be doing this?
Thanks,
Bill
---
Bill Rausch, Software Development, Unix, Mac, Windows
Numerical Applications, Inc. 509-943-0861 bill@numerical.com