title: Sending a binary file in Tornado
body: <p>In a certain <code>GET</code> request, I need to read a file locally, depending on parameters in the request, and send it on request's input stream. How do I do it?</p>
  
  <pre><code>class GetArchives(tornado.web.RequestHandler):
      def get(self, param1, param2):
          path = calculate_path(param1, param2)
          try:
              f = open(path, 'rb')
              # TODO: send this file to request's input stream.
          except IOError:
              raise tornado.web.HTTPError(404, 'Invalid archive')
  </code></pre>