From: kosuri dot s dot raju at chase dot com
Operating system: Win 2000 (build 2195), SP4
PHP version: 4.3.10
PHP Bug Type: Output Control
Bug description: An extra Line Feed ( 0x0A) is added when downloading Files
Description:
------------
Environment:
Windows 2000, V5.0.2195 SP 4
Sun one Webserver 6.1 SP2
PHP 4.3.10 (cgi-fcgi) (built: Dec 14 2004 17:47:59)
Using NSAPI
MySQL
Browser: IE6.0
When dowloading a file ( both text and Binary files ), an extra LF
Character (0x0A) is always prepende to the output. This is only happening
in the above environment. The data is stored properly on the MySql
Server. Works OK on Windows XP , SP2 ( environment)
Reproduce code:
---------------
Sample Code:
$inData = // Read Data from mySQL
$ctype = "text/plain" ; // or like appilcation/msword
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: public");
header("Content-type: $ctype");
header( "Content-Disposition: attachment; filename=".$filenam );
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".$filesize);
echo($inData);
exit;
Expected result:
----------------
The output should not contain additional LineFeed character at the start
of output
Actual result:
--------------
<LF> --- This is Extra Linefeed ( 0x0A)
BBBBB
--
Edit bug report at http://bugs.php.net/?id=32678&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=32678&r=trysnapshot4
Try a CVS snapshot (php5.0):
http://bugs.php.net/fix.php?id=32678&r=trysnapshot50
Try a CVS snapshot (php5.1):
http://bugs.php.net/fix.php?id=32678&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=32678&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=32678&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=32678&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=32678&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=32678&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=32678&r=support
Expected behavior: http://bugs.php.net/fix.php?id=32678&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=32678&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=32678&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=32678&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=32678&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=32678&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=32678&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=32678&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=32678&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=32678&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=32678&r=mysqlcfg