note 24332 added to function.header
| From: | jpirkey at email dot com | Date: | Tue, 13 Aug 2002 15:10:35 +0000 |
| Subject: | note 24332 added to function.header | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-34936@lists.php.net to get a copy of this message | ||
In attempting to download some rather large c++ source code files (1MB+) with Apache 2.0.39 and PHP
4.2.2 via the following header commands:
header("Cache-control: private");
header("Content-Type: text");
header("Content-Length: 1290424");
header("Content-Disposition:attachment; filename=module1.cc.001");
I ran into the issue of the files getting corrupted (i.e. files were scrambled and contained wierd
control characters). The files displayed fine if I did not try to download them but let the default
content type take effect (text/html).
I fixed this by changing the "output_buffering" option in the php.ini to a value larger
than my largested source file size 4000000 [~4MB]. The default size in the PHP 4.2.2 php.ini file
is 4096 [4KB].
If someone else has any other suggestions concerning this matter, I check this documentation quite
often or feel free to email me directly.
--
http://www.php.net/manual/en/function.header.php
http://master.php.net/manage/user-notes.php?action=edit+24332
http://master.php.net/manage/user-notes.php?action=delete+24332
http://master.php.net/manage/user-notes.php?action=reject+24332