hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: retreving file size and file name
Date Fri, 17 Nov 2006 15:44:25 GMT
On Mon, 2006-11-13 at 14:06 +0800, sljm12 wrote:
> Hi all, have 2 questions.
> 
> Some background, I am writing a simple downloader that uses regular expressions to download
files from a forum.
> 
> 1. How do i retrieve the file size of the file that i am downloading?
> 

Stephen,

If you want to find out properties of a remote entity (such as its
Content-Length, for instance) without actually retrieving it, you may
want to use HTTP HEAD. Target servers are expected to generate exactly
the same response header to an HTTP HEAD request if though it was a
regular HTTP GET, but they are not supposed not send the response body. 

Hope this helps

Oleg



> 2. The forum uses php, and the link to the files are usually something like "http://www.insertservername.com/attachment.php?123013"
using a web browser for downloads the brower is able to know the resultant file name, how
do i do that in HttpClient?
> 
> Pretty new to HttpClient and will appreciate any help.
> 
> Regards
> Stephen
> 
> ---------------------------------------------------------------------
> 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


Mime
View raw message