Doc #62074 [Com]: problematic header fields in example
| From: | phpmpan at mpan dot pl | Date: | Mon, 21 May 2012 07:32:46 +0000 |
| Subject: | Doc #62074 [Com]: problematic header fields in example | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-8377@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=62074&edit=1
ID: 62074
Comment by: phpmpan at mpan dot pl
Reported by: julian dot reschke at gmx dot de
Summary: problematic header fields in example
Status: Open
Type: Documentation Problem
Package: Documentation problem
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
> header('Content-Description: File Transfer');
> This header field does not exist in HTTP.
It does. See 2045 8.
> header('Content-Type: application/octet-stream');
> This header field should either be set to the actual
> media type, or not set at all.
This is actual media type and it's perfectly valid content type identifier registered by IANA.
See 2046 4.5.1.
> header('Content-Transfer-Encoding: binary');
> This header field does not exist in HTTP.
It does. See 2045 6.1.
At least the last two cases are also a /de facto/ industry standard, both are widely accepted.
Previous Comments:
------------------------------------------------------------------------
[2012-05-20 07:48:44] julian dot reschke at gmx dot de
Description:
------------
---
From manual page: http://www.php.net/function.readfile#refsect1-
function.readfile-examples
---
header('Content-Description: File Transfer');
This header field does not exist in HTTP.
header('Content-Type: application/octet-stream');
This header field should either be set to the actual media type, or not set at
all.
header('Content-Disposition: attachment; filename='.basename($file));
This code will break if the filename contains non-token characters, such as ",",
";" or non-ASCII characters. See RFC 6266.
header('Content-Transfer-Encoding: binary');
This header field does not exist in HTTP.
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
header('Content-Length: ' . filesize($file));
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=62074&edit=1