Hello,
I have a strange problem with a download script. Here is the situation:
On my development server, the php is 4.0.6 while on the application
server it is 4.3.2. I created a very simple code for opening pdf in
browser. the main part of it is like following:
<?
session_start ();
...
$docPath = '/path/to/file_name.pdf';
$pdftmp_name = 'tmp_name.pdf';
header ('Cache-Control: no-store, no-cache, must-revalidate');
header ('Content-Type: application/pdf');
header ('Content-disposition: inline; filename=' . $pdftmp_name);
header ('Content-length: ' . filesize ($docPath));
readfile ($docPath);
?>
This code is working perfect on development server. However
on the application server, it will first ask for confirm downloading
then report error saying that cannot download.
I checked the code line by line and found that if remove the first
line "session_start ()" then it will work in the correct way. However
session is required for this script. I don't understand why it works
OK on the development server but not for application server.
Thanks in advance for all help!
Alex Shi
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php