How to download a copied file to the Upload folder

31 views
Skip to first unread message

Luis Sucuc

unread,
Oct 29, 2018, 10:46:22 AM10/29/18
to web2py-users

Hello! The previous programmer copied files directly into the Uploads folder, I need to be able to download them now but using the following does not work.


My view

<a class="btn btn-circle btn-default btn-sm" href="{{=URL('administrator','download', args='document.docx')}}">
   <i class="fa fa-download"></i>
</a>


In administrator.py

@cache.action()
def download():
   return response.download(request, db)



The application is already in production, I can not change the way to "upload" the files.

黄祥

unread,
Oct 29, 2018, 1:11:36 PM10/29/18
to web2py-users
not sure, fully understand what you want to achieve it, think you want to have the files in uploads folder, then why not remote the server then copy it via terminal (rsync, scp, etc) ?
if you want to do it in web2py way perhaps you can try :

not sure the 'web2py' download function can fulfilled what you want.

best regards,
stifan
Reply all
Reply to author
Forward
0 new messages