fixed issue 1268, better grid search options, thanks Paolo Angulo
This commit is contained in:
+4
-2
@@ -375,7 +375,7 @@ class Response(Storage):
|
||||
wrapped = streamer(stream, chunk_size=chunk_size)
|
||||
return wrapped
|
||||
|
||||
def download(self, request, db, chunk_size=DEFAULT_CHUNK_SIZE, attachment=True):
|
||||
def download(self, request, db, chunk_size=DEFAULT_CHUNK_SIZE, attachment=True, download_filename=None):
|
||||
"""
|
||||
example of usage in controller::
|
||||
|
||||
@@ -403,9 +403,11 @@ class Response(Storage):
|
||||
raise HTTP(404)
|
||||
headers = self.headers
|
||||
headers['Content-Type'] = contenttype(name)
|
||||
if download_filename == None:
|
||||
download_filename = filename
|
||||
if attachment:
|
||||
headers['Content-Disposition'] = \
|
||||
'attachment; filename="%s"' % filename.replace('"','\"')
|
||||
'attachment; filename="%s"' % download_filename.replace('"','\"')
|
||||
return self.stream(stream, chunk_size=chunk_size, request=request)
|
||||
|
||||
def json(self, data, default=None):
|
||||
|
||||
Reference in New Issue
Block a user