#39745 [Opn->Bgs]: can't get partial contents with streams
| From: | tony2001@php.net | Date: | Tue, 05 Dec 2006 18:45:39 +0000 |
| Subject: | #39745 [Opn->Bgs]: can't get partial contents with streams | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-105951@lists.php.net to get a copy of this message | ||
ID: 39745
Updated by: tony2001@php.net
Reported By: siegfri3d at gmail dot com
-Status: Open
+Status: Bogus
Bug Type: Streams related
Operating System: Linux debian sid, windows xp sp2
PHP Version: 5.2.0
New Comment:
Well, www.google.it just doesn't support it.
You can verify it with www.example.com, which understands Range header
just fine.
Previous Comments:
------------------------------------------------------------------------
[2006-12-05 17:06:49] siegfri3d at gmail dot com
Description:
------------
see bug http://bugs.php.net/bug.php?id=36857
The man answered but you never replied.
He also posted an example on http://it2.php.net/file_get_contents on
how to get a partial content with file_get_contents, it was working
according to him, now it doesn't work anymore. For me it returns the
whole content, maybe the syntax is wrong? If so it would be nice to
correct it on the php.net page
Reproduce code:
---------------
<?php
$context=array('http' => array ('header'=> 'Range: bytes=1-20',
),);
$xcontext = stream_context_create($context);
$str=file_get_contents("http://www.google.it",FALSE,$xcontext);
echo $str;
?>
Expected result:
----------------
that it returns the 20 first bytes of www.google.it.
Actual result:
--------------
It returns the whole page
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=39745&edit=1