hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominic Mitchell <...@semantico.com>
Subject Re: Downloading files with http client
Date Wed, 02 Feb 2005 14:40:39 GMT
ergodic 7 wrote:
> Is there any way of finding out the size of a file
> before downloading it via the get method?
> 
> GetMethod method = new GetMethod(url);
> method.getResponseBody();

You could try using a HeadMethod and querying the Content-Length, but 
that's not guaranteed to be present...

-Dom

-- 
| Semantico: creators of major online resources          |
|       URL: http://www.semantico.com/                   |
|       Tel: +44 (1273) 722222 / Fax: +44 (1273) 723232  |
|   Address: 33 Bond St., Brighton, Sussex, BN1 1RD, UK. |


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


Mime
View raw message