~jamesh/loggerhead/devel

« back to all changes in this revision

Viewing changes to loggerhead/controllers/download_ui.py

  • Committer: James Henstridge
  • Date: 2007-01-25 02:43:08 UTC
  • mfrom: (97.1.13 loggerhead)
  • Revision ID: james@jamesh.id.au-20070125024308-w3gyvoo5830hcvr2
merge from robey's branch

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
        
53
53
        revid = h.fix_revid(args[0])
54
54
        file_id = args[1]
55
 
        filename, content = h.get_file(file_id, revid)
 
55
        path, filename, content = h.get_file(file_id, revid)
56
56
        mime_type, encoding = mimetypes.guess_type(filename)
57
57
        if mime_type is None:
58
58
            mime_type = 'application/octet-stream'
59
 
        
 
59
 
 
60
        self.log.info('/download %s @ %s (%d bytes)', path, h.get_revno(revid), len(content))
60
61
        response.headers['Content-Type'] = mime_type
61
62
        response.headers['Content-Length'] = len(content)
62
63
        response.body = content