Filenames of files downloaded via urlretrieve that have been redirected

Ray Slakinski ray.slakinski at gmail.com
Tue May 10 12:31:04 EDT 2005


I got a small issue, I am using urllib.urlretreive to download files
but in some cases I'm downloading from a CGI that is redirecting
urlretrieve to a different url.

Example:

urllib.urlretreive('http://someurl.com/files.asp?file=55',
'tempFileName.tmp')

Is there a way to know what filename files.asp is redirecting to so I
can rename tempFileName.tmp to the correct name?

Thanks in advance,
Ray




More information about the Python-list mailing list