Using "Content-Disposition" in HTTP download

dclist at gmail.com dclist at gmail.com
Mon Sep 4 13:01:55 EDT 2006


What is the correct way to download a file through HTTP and save it to
the file name suggested by "Content-Disposition"?

I would use urlretrieve but I'm not sure how to obtain the file name
through the HTTP headers without downloading the body (e.g.
urlopen(url).info()).




More information about the Python-list mailing list