modifié: superTornado.py

This commit is contained in:
sidya82 2014-02-28 03:16:09 +01:00
parent 38f40916d2
commit bb316f1f71
1 changed files with 6 additions and 2 deletions

View File

@ -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),