Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Changeset 1084

Show
Ignore:
Timestamp:
05/01/06 18:59:49
Author:
fumanchu
Message:

New static.serve_download function (sugar for serve_file with application/x-download attachment).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/cherrypy/lib/static.py

    r1075 r1084  
    149149    return response.body 
    150150 
     151def serve_download(path, name=None): 
     152    """Serve 'path' as an application/x-download attachment.""" 
     153    # This is such a common idiom I felt it deserved its own wrapper. 
     154    return serve_file(path, "application/x-download", "attachment", name) 
    151155 
    152156 

Hosted by WebFaction

Log in as guest/cpguest to create tickets