From 57c5fb64f6d056d67302a3377d814f14f2a29104 Mon Sep 17 00:00:00 2001 From: mdipierro Date: Mon, 12 Jan 2015 21:00:49 -0600 Subject: [PATCH] fixed issue 1978, thanks mbelletti --- VERSION | 2 +- gluon/sqlhtml.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 1ff6dcfe..8cc74977 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.9.12-beta+timestamp.2015.01.12.20.53.19 +Version 2.9.12-beta+timestamp.2015.01.12.21.00.43 diff --git a/gluon/sqlhtml.py b/gluon/sqlhtml.py index 2058f291..28c37615 100644 --- a/gluon/sqlhtml.py +++ b/gluon/sqlhtml.py @@ -2348,7 +2348,9 @@ class SQLFORM(FORM): # expcolumns is all cols to be exported including virtual fields rows.colnames = expcolumns oExp = clazz(rows) - filename = '.'.join(('rows', oExp.file_ext)) + export_filename = \ + request.vars.get('_export_filename') or 'rows' + filename = '.'.join((export_filename, oExp.file_ext)) response.headers['Content-Type'] = oExp.content_type response.headers['Content-Disposition'] = \ 'attachment;filename=' + filename + ';'