Massimo,

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)

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to