HTTP range headers [WAS: How to count transfered kBytes in File-Download]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am 2009-01-04 09:23:46, schrieb Ashley Sheridan:
> On Sat, 2009-01-03 at 23:41 -0800, mike wrote:
> > I actually use $_SERVER['HTTP_CONTENT_RANGE'] in my setup (nginx +
> > php-fpm) - I don't think I get an 'HTTP_RANGE' ...

> I'm still a little confused on this though. How would a browser send
> this to notify of a download that was only partially completed before?

Lets try it:

----[ STDIN ]-----------------------------------------------------------
[michelle.konzack@tp570:/tmp] wget -S "http://www.tamay-dogan.net/foo/xxxxxxxxxxxxxxx.xxx";
--15:07:53--  http://www.tamay-dogan.net/foo/xxxxxxxxxxxxxxx.xxx
           => `xxxxxxxxxxxxxxx.xxx'
Auflösen des Hostnamen »www.tamay-dogan.net«.... 88.198.11.108
Verbindungsaufbau zu www.tamay-dogan.net[88.198.11.108]:80... verbunden.
HTTP Anforderung gesendet, warte auf Antwort...
 1 HTTP/1.1 200 OK
 2 Date: Sun, 04 Jan 2009 14:11:51 GMT
 3 Server: Apache
 4 Last-Modified: Thu, 01 Jan 2009 00:23:18 GMT
 5 ETag: "63fbad-ba6b4-45f60d4c4a980"
 6 Accept-Ranges: bytes
 7 Content-Length: 763572
 8 Keep-Alive: timeout=15, max=100
 9 Connection: Keep-Alive
10 Content-Type: text/plain

72% [=========================>           ] 551,021        7.38K/s    ETA 00:28

[michelle.konzack@tp570:/tmp] wget -S -c "http://www.tamay-dogan.net/foo/xxxxxxxxxxxxxxx.xxx";
--15:09:17--  http://www.tamay-dogan.net/foo/xxxxxxxxxxxxxxx.xxx
           => `xxxxxxxxxxxxxxx.xxx'
Auflösen des Hostnamen »www.tamay-dogan.net«.... 88.198.11.108
Verbindungsaufbau zu www.tamay-dogan.net[88.198.11.108]:80... verbunden.
HTTP Anforderung gesendet, warte auf Antwort...
 1 HTTP/1.1 206 Partial Content
 2 Date: Sun, 04 Jan 2009 14:13:14 GMT
 3 Server: Apache
 4 Last-Modified: Thu, 01 Jan 2009 00:23:18 GMT
 5 ETag: "63fbad-ba6b4-45f60d4c4a980"
 6 Accept-Ranges: bytes
 7 Content-Length: 211183
 8 Content-Range: bytes 552389-763571/763572
 9 Keep-Alive: timeout=15, max=100
10 Connection: Keep-Alive
11 Content-Type: text/plain

100%[++++++++++++++++++++++++++==========>] 763,572        7.48K/s    ETA 00:00

15:09:45 (7.29 KB/s) - »xxxxxxxxxxxxxxx.xxx« gespeichert [763572/763572]
------------------------------------------------------------------------

OK, this mean, the name of the HTTP headers are

    $_SERVER['CONTENT_LENGTH']

which tell the server HOW MANY Bytes I wan to get and

    $_SERVER['CONTENT_RANGE']

which tell the server where to START and to END, but I do not understand
WHY the range is ONE BYTE less then the TOTAL LENGTH.

Does someone know more about it?

Hey *, if my function pushBinary() is properly supporting this  kind  of
stuff, it solve a very big problem on my website  and  my  customers  of
course.

Thanks, Greetings and nice Day/Evening
    Michelle Konzack
    Systemadministrator
    24V Electronic Engineer
    Tamay Dogan Network
    Debian GNU/Linux Consultant


-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
##################### Debian GNU/Linux Consultant #####################
<http://www.tamay-dogan.net/>               <http://www.can4linux.org/>
Michelle Konzack   Apt. 917                  ICQ #328449886
+49/177/9351947    50, rue de Soultz         MSN LinuxMichi
+33/6/61925193     67100 Strasbourg/France   IRC #Debian (irc.icq.com)

<<attachment: signature.pgp>>


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux