Page 1 of 1

Help with download window please

Posted: Tue Aug 05, 2003 8:40 am
by GregArtemides
I want to force a download of a .txt file without IE opening it in the browser. I just need the download window to appear. How do I do it?
currently I am using (which opens the text file in the browser):

Code: Select all

header("Content-type: text/plain");
header("Content-Disposition: inline; filename=somefile.txt");
header("Expires: 0"); 
header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); 
header("Pragma: public"); 

readfile($FilePath);
:?:

Posted: Tue Aug 05, 2003 9:50 am
by pootergeist
header("Content-Type: text/plain");
header("Content-Length: ".filesize($long_fname));
header("Content-Disposition: attachment; filename=whatever.whatever");
header("Content-Transfer-Encoding: ascii");

should suffice - amend the whatever.whatever variable values