From: Frédéric Péters Date: Sun, 15 May 2016 13:06:00 +0000 (+0200) Subject: use filename from request path if available X-Git-Url: https://git.0d.be/?p=pige-extractor.git;a=commitdiff_plain;h=01e28afcdfcf8cf48e5d4a01615e847e1393caf1 use filename from request path if available --- diff --git a/download.cgi b/download.cgi index 7d04df7..374d63f 100755 --- a/download.cgi +++ b/download.cgi @@ -54,6 +54,8 @@ elif d: ext = 'wav' else: ext = 'ogg' + filename = '%s-%s.ext' % ( + start.strftime('%Y-%m-%d-%Hh%M'), end.strftime('%Hh%M'), ext) else: print 'Location: .' print '' @@ -127,8 +129,7 @@ if ext == 'wav': else: print 'Content-Type: audio/ogg' -print 'Content-Disposition: attachment; filename=%s.%s\n' % \ - (start.strftime('%Y-%m-%d-%Hh%M') + end.strftime('-%Hh%M'), ext) +print 'Content-Disposition: attachment; filename=%s\n' % filename sys.stdout.flush()