Re: Forcing renaming of download file (want output from a php file being saved as some particular file by browser)
| From: | bard | Date: | Wed, 17 Jan 2001 13:25:22 +0000 |
| Subject: | Re: Forcing renaming of download file (want output from a php file being saved as some particular file by browser) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-35028@lists.php.net to get a copy of this message | ||
On Wed, 17 Jan 2001, Pankaj Gupta wrote:
> Forcing a download is easy, but how can I tell the browser to name that file
> to something particular, say data1.txt
> Is there a header for that?
There sure is:
header("Content-disposition: filename=data1.txt");
BTW, I've been using that for a while, but I'm pretty sure I originally got
it from reading the user comments on http://php.net/header.
You can learn a lot from the people who post comments there. Whenever I
look up syntax, I ALWAYS check them.
Cheers,
brad