Download binary

I am creating a server using python and bottle.

How can I handle a request for a binary file?

I read that I have to use a flask. Is there any way to do this without using a bulb?

+6
source share
1 answer

Yes, you should use the 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) 
+7
source

All Articles