web2py/web2py — pull request #50 by lucadealfaro (2013-01-10 16:46:10+00:00)
Title: Enable renaming of downloaded file

We are developing a submission review and ranking system, and we needed to be able to rename files downloaded, so that something uploaded as dealfaro_paper.pdf would be renamed to (e.g.) submission_23.pdf on download.
The simplest way to do this was to add an extra optional parameter to request.download, allowing the specification of a new file name for download.
We are wondering whether this may be of wider interest.
Note that we are not checking that the original and new filenames have the same extension. This would have to be done separately. We did not want to hard-code this, since it may be reasonable to use this parameter to change e.g. Picture1.JPG into picture1.jpg on download.