Re: [PHP] Extra byte added to PDF streaming file

2004-07-27 Thread Larry E . Ullman
I've seen cases where extra buffer content gets added to the downloaded file. The problem was fixed by deleting any existing buffer before sending the file to the client. Not sure that will solve the problem but it's worth a shot. How does one delete an existing buffer? ob_end_flush();?

Re: [PHP] Extra byte added to PDF streaming file

2004-07-27 Thread Scott Taylor
Larry E. Ullman wrote: I've seen cases where extra buffer content gets added to the downloaded file. The problem was fixed by deleting any existing buffer before sending the file to the client. Not sure that will solve the problem but it's worth a shot. How does one delete an existing buffer?

[PHP] Extra byte added to PDF streaming file

2004-07-26 Thread Scott Taylor
I'm using this code to stream a PDF file: $file = $_SERVER['DOCUMENT_ROOT'] . /file.pdf; simple_streamfile($file); function simple_streamfile($file) { $fp = fopen($file, 'rb'); // send the right headers header(Content-Type: application/pdf); header(Content-Length: .

Re: [PHP] Extra byte added to PDF streaming file

2004-07-26 Thread Larry E . Ullman
It appears as though some readers (such as adobe acrobat) can read this file fine yet others (such as the program gv in *NIX) cannot read it. The reason for this is that somehow a hex 0A is added before the inital %PDF-1.2 which marks the start of the PDF file causing some readers to not

Re: [PHP] Extra byte added to PDF streaming file

2004-07-26 Thread Curt Zirzow
* Thus wrote Scott Taylor: $fp = fopen($file, 'rb'); // send the right headers header(Content-Type: application/pdf); header(Content-Length: . filesize($file)); // dump the file and stop the script fpassthru($fp); ... The reason for this is that somehow a hex 0A is