[BangPypers] How to check file size before downloading it

Gurpreet Sachdeva gurpreet.sachdeva at gmail.com
Thu May 8 07:45:22 CEST 2008


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 <srsy70 at gmail.com> wrote:

> On Wed, May 7, 2008 at 4:49 PM, Gurpreet Sachdeva
> <gurpreet.sachdeva at gmail.com> 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 header before trying to  find it's value. It's quite
> common to find web servers that do not report this header. (Now you
> know one reason why progress bars can be cranky at times : )
>
> Ramaswamy
> _______________________________________________
> BangPypers mailing list
> BangPypers at python.org
> http://mail.python.org/mailman/listinfo/bangpypers
>



-- 
Thanks and Regards,
Gurpreet Singh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/bangpypers/attachments/20080508/80785949/attachment-0001.htm>


More information about the BangPypers mailing list