Forcing renaming of download file (want output from a php file being saved as some particular file by browser)
| From: | Pankaj Gupta | Date: | Wed, 17 Jan 2001 10:11:48 +0000 |
| Subject: | Forcing renaming of download file (want output from a php file being saved as some particular file by browser) | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-35007@lists.php.net to get a copy of this message | ||
Forcing renaming of download file (want output from a php file being saved
as some particular file by browser)
Hello
I have a php file abc.php which outputs some data (which it collects from a
database somhow). Now I want to force a download/open dialogue box and to
give a name to the file in which the browser will store that date.
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?
One way around would be to store the data in a temporary file accessible to
that user and then redirect the browser to that file. But there might be a
better and more secure way.
Regards
Pankaj
----------------------------------------------------------------------------
-------------------------------------------
Pankaj Gupta
Senior Undergraduate,
Deptt. of Computer Science and Engineering,
Indian Institute of Technology, Kanpur.
http://www.waytobiz.com/pankajresume1.php3
----------------------------------------------------------------------------
-------------------------------------------