There's default/download function, usually used like this on files that
were uploaded:
<a href="{{=URL('default', 'download', args=[filename])}}">Download</a>
In this case, I do not want to keep the full download path in my <a> tag.
Instead, when the link is clicked, I would like to redirect to another
function, which will proceed with the download based on request.args(0).
I tried to do the following but nothing happens after clicking the link:
link
<a href={{=URL('controller', 'download_file')}}>Download</a>
controller/download_file
def download_file():
file = db(db.files.user_id == int(request.args(0))).select()
for f in file:
name = f.name
return response.download(name,db)
--
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.