Barry wrote:
Peter Lauri schrieb:
Ok, my knowledge about HTTP is not the best. But how can you send three
different content-type headers? :)
There are not so different at all.
Just giving the browser the job to download that thing.
Every browser likes to interpret every content-type like he wants to.
They ignore mostly every type they dislike.
According to the manual, header() will replace previous "similar
headers" with the new one sent, which would be
header("Content-Type: application/download");
"The optional replace parameter indicates whether the header should
replace a previous similar header, or add a second header of the same
type. By default it will replace, but if you pass in FALSE as the second
argument you can force multiple headers of the same type"
[1]http://php.net/header
As for the value of Content-Type it doesn't matter, you only have to
specify an unknown (MIME) type so the browser won't know what to do with
it, hence forcing to download the file.
As minor notes (after reading a bit the RFC)... "Expires" is expected
to be a date, not a number, and "Pragma" value conflicts with
Cache-control, since...
public
Indicates that the response MAY be cached by any cache, even if it
would normally be non-cacheable or cacheable only within a non-
shared cache. (See also Authorization, section 14.8, for
additional details.)
Also, it seems we're given a wrong use for "must-revalidate" (me
included), that or I misunderstood the RFC documentation --I didn't even
found "pre-check" & "post-check". Content-Disposition is not part of
the HTTP standard and Content-Transfer-Encoding is ignored, since both
seem to be for e-mail usage (LOL) --and it's possible values are
"quoted-printable" o "base64"--. Finally, "Content-Length" and
"Content-Type" seem to apply only if "had the request been a GET".
Interesting what you learn reading the RFCs, too bad they're too long
and sometimes not that clear.
RFC: http://www.faqs.org/rfcs/rfc2616
--
Atentamente / Sincerely,
J. Rafael Salazar Magaña
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php