~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to loggerhead/controllers/download_ui.py

  • Committer: Martin Pool
  • Date: 2009-03-10 01:01:04 UTC
  • mto: This revision was merged to the branch mainline in revision 298.
  • Revision ID: mbp@sourcefrog.net-20090310010104-o75ncguznrridwaz
optparse may have already parsed port as an int

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
import logging
21
21
import mimetypes
22
22
import time
23
 
import urllib
24
23
 
25
24
from paste import httpexceptions
26
25
from paste.request import path_info_pop
60
59
                      path,
61
60
                      h.get_revno(revid),
62
61
                      len(content))
63
 
        encoded_filename = urllib.quote(filename.encode('utf-8'))
64
62
        headers = [
65
63
            ('Content-Type', mime_type),
66
64
            ('Content-Length', len(content)),
67
 
            ('Content-Disposition',
68
 
             'attachment; filename*=utf-8\'\'%s' % encoded_filename),
 
65
            ('Content-Disposition', 'attachment; filename=%s' % filename),
69
66
            ]
70
67
        start_response('200 OK', headers)
71
68
        return [content]