Open r0uted opened 12 months ago
This works for me:
@server.route('/db', methods=['GET'])
def download_db(request):
with open('database.txt', 'r') as f:
content = f.read()
return server.Response(body=content,
status=200,
headers={"Content-Disposition": "attachment;filename=db.csv",
"Content-Type": "text/csv",
"Content-Length": len(content)})
How do I download a file? I want to show all files in .html When use press one file, web server should be able to send that file so user can download.
i can only stream the log files and other files. But i need option to download files too.
Any help? thanks