You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by onin <jn...@mobius.ph> on 2006/03/30 05:06:01 UTC

get file size of download

hi all!

im using httpclient getmethod and i'd like to know
how can i get the file size of the file im currently downloading?
whats the method i should use,
or api should read.

thanks.


-- 
"A whim, a thought, and more is sought... awake, my mind... thy will be wrought!"



---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org


Re: get file size of download

Posted by Roland Weber <ht...@dubioso.net>.
Bindul Bhowmik wrote:
> On 3/29/06, onin <jn...@mobius.ph> wrote:
> 
>>hi all!
>>
>>im using httpclient getmethod and i'd like to know
>>how can i get the file size of the file im currently downloading?
> 
> 
> You could look at the 'Content-Length' header field. Most servers set
> that field.

The Content-Length header will typically be set if you download
static content, like image files or a static HTML page. If you
are downloading a dynamically generated page, for example a JSP,
it will be missing. The server doesn't know the document size in
advance, and neither will the client.

cheers,
  Roland

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org


Re: get file size of download

Posted by Bindul Bhowmik <bi...@gmail.com>.
On 3/29/06, onin <jn...@mobius.ph> wrote:
> hi all!
>
> im using httpclient getmethod and i'd like to know
> how can i get the file size of the file im currently downloading?

You could look at the 'Content-Length' header field. Most servers set
that field.

> whats the method i should use,
> or api should read.
>
> thanks.
>
>
> --
> "A whim, a thought, and more is sought... awake, my mind... thy will be wrought!"
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org