You are here: Re: [PHP] Checking requested range « PHP « IT news, forums, messages
Re: [PHP] Checking requested range

Posted by Jochem Maas on 09/28/67 11:19

Neil Doody wrote:
> Marek Kilimajer wrote:
>
>> Try http://pear.php.net/package/HTTP_Download
>
>
> Cheers for that, I think I just found a reasonable method to do a short
> term fix, though I might totally redesign my download application to
> support resumable download agents. I looked on the HTTP 1.1 protocol
> and found the request headers used when requesting parts of a file is
> "Range:".
>
> For now I put this at the top of my script :-
>
> $headers = apache_request_headers();
> foreach ($headers as $header => $value) {
> if (stristr($header, "range") != FALSE) { die; }

you might want to check for "Range:" (case-sensitive)
or "range:" (insensitive) instead...

"GET HTTP1.1 /rangerover.html"

but it may be a moot point.

> }
>
>
>
> Using the apache_request_headers to check for the range request and die
> if it recieves it, does it look reasonable to you?

possibly send out an appropriate header before you die()?
(that sounds weird :-)

e.g.

header("Status: 501 Not Implemented");

or

header("Status: 406 Not Acceptable");

I'm not sure which would be more correct, and you may need
to output additional headers to complement these.

more details:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация