For some reason urllib is corrupting documents that i download from a website. The url is definitely correct. The documents download with their correct names but they appear corrupted once opened. There is no encoding on the files so i don't need to decode it. I would really appreciate some help in this problem. Here is a snippet:
def download_file(url, name):
f = urllib.urlopen(url)
fh = open(name, 'wb')
fh.write(f.read())
fh.close()
print " File Downloaded : " , name
except Exception:
raise