I'm trying to downlod a .zip file over HTTP and save it to the local filesystem (then extract it).
... the zip file gets created but it's not a valid .zip (although it does appear to be a binary file). It's A little larger than the original zip.
conn = httplib.HTTPConnection( "www.myserver.com" )
conn.request( "GET", "/images/devnews_images.zip" )
resp = conn.getresponse()
if resp.status != 200 and resp.status != 302:
print "Could not download images. Proceeding without."
fobj = open( dest+"/devnews_images.zip", 'w' )
fobj.write( resp.read() )
Anyone konw if I have to do anything special? I don't see any options for binary mode transfers, but then I thought HTTP was text-only?