I'm building a server using python and bottle.
How can I handle a request for a binary file?
I have read that I should use flask. There is a way for doing that without using flask?
Yes, you should use static_file
function:
from bottle import static_file
@route('/download/<filename:path>')
def download(filename):
return static_file(filename, root='/path/to/static/files', download=filename)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With