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

Changeset 1481

Show
Ignore:
Timestamp:
12/09/06 12:33:08
Author:
fumanchu
Message:

2.x: Buglet in lib.cptools, plus a backport of serve_download. See [1069], [1084].

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/cherrypy-2.x/cherrypy/lib/cptools.py

    r1318 r1481  
    131131     
    132132    if not modified_since(path, stat): 
     133        response.body = [] 
    133134        return [] 
    134135     
     
    198199        response.body = bodyfile 
    199200    return response.body 
     201serve_file = serveFile 
     202 
     203def serve_download(path, name=None): 
     204    """Serve 'path' as an application/x-download attachment.""" 
     205    # This is such a common idiom I felt it deserved its own wrapper. 
     206    return serve_file(path, "application/x-download", "attachment", name) 
    200207 
    201208def fileGenerator(input, chunkSize=65536): 

Hosted by WebFaction

Log in as guest/cpguest to create tickets