* Thus wrote Alex Shi ([EMAIL PROTECTED]):
> 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.
 
I'm not even sure how session_start() can even do a thing like
that.  Unless you have a problem with headers already sent, error.

There was a discussion on this a few weeks back here, but
unfortantly I didn't follow the thread.

hmm.. i think i just rememberd that it might had to do with making 
sure that session.cache_limiter being set as 'nocache'.

Search the archives, the answer is there i believe.

Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to