Hi, I am trying to use StaticFileHandler in Tornado and, for the most part, its work, except for the output of the file (.csv) on the web page when I click the download button. The only way to save the file is to right-click and specify saving the target as (but this does not work in all browsers).
How to make a file load? I know that I need to somehow set the StaticFileHandler header as follows:
self.set_header('Content-Type','text-csv') self.set_header('Content-Disposition','attachment')
But I do not know how to install it, because it is the default handler.
Thank you for your time!
python file tornado static
Nick trileski
source share