Thank you Dave for your advices !
You're right, I didn't look at the "download" function, and I didn't change
it.
I've done this now : (1) I've removed the "auth" condition, and I change
the db to dbW = the database for my app
I also change the line in the view.
New version of download :
def download():
"""
allows downloading of uploaded files
http://..../[app]/default/download/[filename]
"""
return response.download(request, dbW)
And for the view :
Old version
Avec A : {{=A(ligne.Titre, _href=URL('upload',ligne.Document))}}
<br>
New version :
Avec A : {{=A(ligne.Titre, _href=URL('download',args=ligne.Document
))}}<br>
But it doesn't work.
When i move the mouse on the field, I see at the bottom of the screen :
http://127.0.0.1:8000/wfda/default/download/TPJ.Document.bfcea4c64f58c64e.466163743138303832302e706466.pdf
I don't understand how the upload/download works :
For upload, the default directory is <app>/upload/<table>.<field>.xxx.pdf
For download, the directory is
<app>/default/download/<table>.<field>.xxx.pdf
Question :
the "default/download" come from <controller>/<first param of URL> ?
For me, with my tests, the file is always in <app>/upload.
Many thanks for the time you spend with helping developpers :-)
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
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/d/optout.