W3C home > Mailing lists > Public > www-lib@w3.org > October to December 1998

Re: Total length?

From: Henrik Frystyk Nielsen <frystyk@w3.org>
Date: Tue, 15 Dec 1998 20:13:32 -0500
To: www-lib@w3.org
Message-ID: <3677093C.15873847@w3.org>
To: Jim_Ravan@avid.com


Jim_Ravan@avid.com wrote:
> 
> How do I discover the total length of a URL? That is, given that my users
> will call me to read/write pieces of documents, I need to know how big the
> original document is, so I can tell when they're asking me to read/write
> past the end.

All metadata known about a resource is stored in the HTAnchor object. 

	http://www.w3.org/Library/src/HTAnchor.html

When a response is received then it parsed by the HTTP response parser
and the MIME parser

	http://www.w3.org/Library/src/WWWHTTP.html
	http://www.w3.org/Library/src/WWWMIME.html

The result is stored in a HTResponse object

	http://www.w3.org/Library/src/HTResponse.html

When the request is terminated, both the request object and the response
objects can be destroyed. However, if it is a 2xx code, or a 304 code
then the metainformation (length, etags, type, etc.) is stored in a
HTAnchor object. The application can query the Anchor object for all the
metainformation using the HTAnchor methods. For example, the length is

	HTAnchor_length(...)

Henrik
Received on Tuesday, 15 December 1998 20:13:33 EST

This archive was generated by hypermail pre-2.1.9 : Wednesday, 3 September 2003 17:59:24 EDT