Return-Path: Delivered-To: apmail-jakarta-httpclient-user-archive@www.apache.org Received: (qmail 65173 invoked from network); 15 Sep 2005 23:08:19 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 15 Sep 2005 23:08:19 -0000 Received: (qmail 35470 invoked by uid 500); 15 Sep 2005 23:08:18 -0000 Delivered-To: apmail-jakarta-httpclient-user-archive@jakarta.apache.org Received: (qmail 35444 invoked by uid 500); 15 Sep 2005 23:08:17 -0000 Mailing-List: contact httpclient-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: "HttpClient User Discussion" Reply-To: "HttpClient User Discussion" Delivered-To: mailing list httpclient-user@jakarta.apache.org Received: (qmail 35427 invoked by uid 99); 15 Sep 2005 23:08:17 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Sep 2005 16:08:17 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=RCVD_BY_IP,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of mbecke@gmail.com designates 66.249.82.205 as permitted sender) Received: from [66.249.82.205] (HELO xproxy.gmail.com) (66.249.82.205) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Sep 2005 16:08:26 -0700 Received: by xproxy.gmail.com with SMTP id i27so286760wxd for ; Thu, 15 Sep 2005 16:08:14 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=IFFS4F3hvi1XyvyvD3EBOWu0Ax7c+CNfAYOW1KkJiGWcUQSnUBH2I+2tqY61S8sI54wXBhrALfjLkgeOvT+Nwn3hlzuUSKpdUI4k2fwNerWnMrHGFD9ECSzazPfVC0bzbQEB9uuHQB9ShGR53qliIer5UlQUeat9Wx2IXVIozeY= Received: by 10.70.41.15 with SMTP id o15mr25040wxo; Thu, 15 Sep 2005 16:08:12 -0700 (PDT) Received: by 10.70.25.17 with HTTP; Thu, 15 Sep 2005 16:08:10 -0700 (PDT) Message-ID: <78f7873e05091516081a0e3796@mail.gmail.com> Date: Thu, 15 Sep 2005 19:08:10 -0400 From: Michael Becke Reply-To: mbecke@gmail.com To: HttpClient User Discussion Subject: Re: Limit size of file to be downloaded In-Reply-To: <20050915093942.GE400@jdevoff.zssm.zp.ua> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <20050915093942.GE400@jdevoff.zssm.zp.ua> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N The best way is to use getResponseBodyAsStream() and read only as many bytes are you are willing to. If the response ends up being too long, call HttpMethod.abort(). Mike On 9/15/05, Eugeny N Dzhurinsky wrote: > Is there any way to limit size of file to be downloaded by HTTPClient in = case > if there is no content-length provided in HTTP response and file is somet= hing > like 50Mb in size? >=20 > -- > Eugene N Dzhurinsky >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: httpclient-user-help@jakarta.apache.org >=20 > --------------------------------------------------------------------- To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: httpclient-user-help@jakarta.apache.org