#47195 [Opn->WFx]: Class for easier sending HTTP Headers
ID: 47195
Updated by: pajoye@php.net
Reported By: csnaitsirch at web dot de
-Status: Open
+Status: Wont fix
Bug Type: Feature/Change Request
Operating System: Debian/Linux
PHP Version: 5.2.8
New Comment:
Take a look at http://pecl.php.net/http
Previous Comments:
------------------------------------------------------------------------
[2009-01-23 09:04:20] csnaitsirch at web dot de
Description:
------------
In my opinion it is difficult to send special HTTP headers.
If you create a File programaticly and want to send it to the user, you
have to use something like:
<?php
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=\"file.csv\"");
header("Content-Length: ".strlen($csv));
?>
So I have written some classes to make it easier.
The same result of the upper example will be reached with the
following:
<?php
$h = new HTTPHeader();
$h->ContentType()->ApplicationOctetStream();
$h->ContentDisposition()->Attachment()->Filename("file.csv");
$h->ContentLength($csv);
?>
If you think it would be a helpful class mail me.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=47195&edit=1
Thread (2 messages)