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-Length header.

$ curl -I http://www.google.com/favicon.ico
HTTP/1.1 200 OK
Content-Type: image/x-icon
Last-Modified: Wed, 07 Jun 2006 19:35:34 GMT
Expires: Sun, 17 Jan 2038 19:14:07 GMT
Date: Wed, 07 May 2008 11:45:57 GMT
Server: gws
Content-Length: 1406
Age: 7
_______________________________________________
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers

Reply via email to