urlretrieve returns an empty file
Question
I'm trying to use urlretrieve to download files from urls that take the form:
http://example.com/download.php?id=6456&name=foo
yet for some reason I just get an empty response.
I've tried the method suggested in this question didn't seem to help because
remotefile.info()
doesn't contain the key 'content-disposition', only
['content-length', 'x-powered-by', 'refresh', 'server', 'connection', 'date', 'content-type']
Any suggestions?
Solution
Information from manual:
info() — return the meta-information of the page, such as headers, in the form of an httplib.HTTPMessage instance (see Quick Reference to HTTP Headers)
What keys do you have in dict remotefile.info()?
Can you get a full header information?
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow