[BangPypers] How to check file size before downloading it

Vinayak Hegde vinayakh at gmail.com
Wed May 7 13:47:26 CEST 2008


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 do a HEAD http request and check the content-length header of the
server's http response.

-- Vinayak
-- 
http://www.linkedin.com/in/VinayakH


More information about the BangPypers mailing list