diff --git a/superTornado.py b/superTornado.py index 295aa50..c69250b 100644 --- a/superTornado.py +++ b/superTornado.py @@ -3,6 +3,7 @@ import tornado.web import tornado.httpserver import tornado.websocket import tornado.options +import base64 from urllib import urlretrieve @@ -78,11 +79,14 @@ class AJAXHandler(BaseHandler): def post(self): with open("image/temp.jpg", 'rb') as f: data = f.read() - self.set_header('Content-type', 'image/jpeg') - self.write(data) + #self.set_header('Content-type', 'image/jpeg') + encoded = base64.b64encode(data) + print encoded + self.write(encoded) self.finish() + application = tornado.web.Application([ (r"/", MainHandler), (r"/video", VideoHandler),