On Thu, May 8, 2008 at 11:15 AM, Gurpreet Sachdeva
<[EMAIL PROTECTED]> wrote:
> Yeah thats what I found. Any idea what settings need to be done in the
> webserver (Apache) to report content-length header? Or any other
> alternative?
>
> Thanks for your help,
> Gurpreet
>
AFAIK, Apache 2 reports Con
On Wed, May 7, 2008 at 5:53 PM, Akash <[EMAIL PROTECTED]> wrote:
> On Wed, May 7, 2008 at 5:41 PM, Anand Balachandran Pillai
> <[EMAIL PROTECTED]> wrote:
>
> > Make a HEAD request. Here is one way of doing it, using urllib2.
>
> Since we are on the subject of urllib2. Any resources you recommend
Yeah thats what I found. Any idea what settings need to be done in the
webserver (Apache) to report content-length header? Or any other
alternative?
Thanks for your help,
Gurpreet
On Wed, May 7, 2008 at 10:19 PM, S.Ramaswamy <[EMAIL PROTECTED]> wrote:
> On Wed, May 7, 2008 at 4:49 PM, Gurpreet S
On Wed, May 7, 2008 at 4:49 PM, Gurpreet Sachdeva
<[EMAIL PROTECTED]> wrote:
> Is there a way in urllib to check file size (from the webserver) before
> downloading it? Or any other python module from this?
>
Just a nit. It might be a good idea to check for the existence of the
Content-Length head
On Wed, May 7, 2008 at 5:41 PM, Anand Balachandran Pillai
<[EMAIL PROTECTED]> wrote:
> Make a HEAD request. Here is one way of doing it, using urllib2.
Since we are on the subject of urllib2. Any resources you recommend
other than the standard python docs ?
I have referred to this sometimes :
htt
On Wed, May 7, 2008 at 5:41 PM, Anand Balachandran Pillai
<[EMAIL PROTECTED]> wrote:
> Make a HEAD request. Here is one way of doing it, using urllib2.
>
> class HeadRequest(urllib2.Request):
> """ A request class which performs a HEAD request """
>
> def get_method(self):
> return
Make a HEAD request. Here is one way of doing it, using urllib2.
class HeadRequest(urllib2.Request):
""" A request class which performs a HEAD request """
def get_method(self):
return 'HEAD'
req = HeadRequest(url)
f = urllib2.urlopen(req)
headers = dict(f.headers)
print headers.g
On Wed, May 7, 2008 at 4:49 PM, Gurpreet Sachdeva
<[EMAIL PROTECTED]> wrote:
> Is there a way in urllib to check file size (from the webserver) before
> downloading it? Or any other python module from this?
If you are on *nix, you can use curl -I to make a HEAD request, which
contains Content-Leng
On Wed, May 7, 2008 at 4:49 PM, Gurpreet Sachdeva
<[EMAIL PROTECTED]> wrote:
> Is there a way in urllib to check file size (from the webserver) before
> downloading it? Or any other python module from this?
Just do a HEAD http request and check the content-length header of the
server's http respon
Is there a way in urllib to check file size (from the webserver) before
downloading it? Or any other python module from this?
Thanks and Regards,
Gurpreet Singh
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/ban
10 matches
Mail list logo