This works as long as there is a field called 'filename' in db.py.
stick this in t2.download at the bottom:
return rows[0][uploadfield]
else:
try:
row=db(db[t][f]==name).select(db[t]['filename'])
response.headers['Content-Disposition']='attachment;
filename="%s"' % row[0].filename
except:
pass
filename=os.path.join(request.folder,'uploads',name or
self._error())
return response.stream(filename)