RE: [PHP] Need to download files in IE

From: Date: Mon, 12 Mar 2001 20:49:41 +0000
Subject: RE: [PHP] Need to download files in IE
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-43547@lists.php.net to get a copy of this message
Hello, This is the URL of the link that I use. http://www.sitename.com/pizzeria.php3?pizzeria=aldentes Here is the code from the script. $file_path = "menus"; $file = $pizzeria . ".pdf"; $full_file = $file_path."/".$file; $filesize=filesize($full_file); header("Content-disposition: attachment; filename=\"$file\""); header("Content-type: application-download"); header("Pragma: no-cache"); header("Expires: 0"); $fn=fopen($full_file,"r"); fpassthru($fn); fclose($fn); exit; I tried it and it did not work. When I click on the link it shows "pizzeria.htm" in the File Name field. Any other suggestions. Regards, Edgar -----Original Message----- From: Pierre-Yves Lemaire [mailto:pylem@sympatico.ca] Sent: Monday, March 12, 2001 10:41 AM To: php-general@lists.php.net Subject: Re: [PHP] Need to download files in IE Hello, I do that with this piece of code. ( This will close the window, so open a new one and put this code inside) header("Content-disposition: attachment; filename=\"$fileName\""); header("Content-type: application-download"); header("Pragma: no-cache"); header("Expires: 0"); $fn=fopen($FileName,"r"); fpassthru($fn); fclose($fn); exit; py ----- Original Message ----- From: James R. Edgar <edgar@webt.com> To: <php-general@lists.php.net> Sent: Monday, March 12, 2001 7:57 PM Subject: [PHP] Need to download files in IE > I am trying to set my script up so that when a person clicks on the link, that > the page will prompt for a download w/ the filename in the File Name field in > the Save As prompt. > I can get this to work in Netscapse but when I try to do it with Internet > Explorer I encounter problems. It either says there is no application to read > the file (I have acrobat reader on the computer.) or it displays the prompt with > either [variable's name passed to script].htm or download.php. And the file I am > trying to download is a PDF file. If anyone can help me with this I would > greatly appreciate this, and thanks in advance. > > Regards, > Edgar > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#43547) next »