note 88722 added to function.virtual
| From: | phpforum at joolee dot nl | Date: | Wed, 04 Feb 2009 20:00:20 +0000 |
| Subject: | note 88722 added to function.virtual | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-150223@lists.php.net to get a copy of this message | ||
Problem with most of the scripts posted below is that virtual() flushes the pending headers before
making the subrequest. Requesting an image with virtual() still returns a text/html type document.
A workaround is to set the content-type first. But that requires getting the content-type first.
I'm using the following script for now. A disadvantage is that Apache makes 2 subrequests.
<?PHP
$file = '/resources/7z.gif';
$file_info = apache_lookup_uri($file);
header('content-type: ' . $file_info -> content_type);
virtual($file);
die();
?>
----
Server IP: 89.248.170.61
Probable Submitter: 82.169.203.155
----
Manual Page -- http://www.php.net/manual/en/function.virtual.php
Edit -- https://master.php.net/note/edit/88722
Del: integrated -- https://master.php.net/note/delete/88722/integrated
Del: useless -- https://master.php.net/note/delete/88722/useless
Del: bad code -- https://master.php.net/note/delete/88722/bad+code
Del: spam -- https://master.php.net/note/delete/88722/spam
Del: non-english -- https://master.php.net/note/delete/88722/non-english
Del: in docs -- https://master.php.net/note/delete/88722/in+docs
Del: other reasons-- https://master.php.net/note/delete/88722
Reject -- https://master.php.net/note/reject/88722
Search -- https://master.php.net/manage/user-notes.php