modifié: superTornado.py
This commit is contained in:
parent
38f40916d2
commit
bb316f1f71
@ -3,6 +3,7 @@ import tornado.web
|
|||||||
import tornado.httpserver
|
import tornado.httpserver
|
||||||
import tornado.websocket
|
import tornado.websocket
|
||||||
import tornado.options
|
import tornado.options
|
||||||
|
import base64
|
||||||
from urllib import urlretrieve
|
from urllib import urlretrieve
|
||||||
|
|
||||||
|
|
||||||
@ -78,11 +79,14 @@ class AJAXHandler(BaseHandler):
|
|||||||
def post(self):
|
def post(self):
|
||||||
with open("image/temp.jpg", 'rb') as f:
|
with open("image/temp.jpg", 'rb') as f:
|
||||||
data = f.read()
|
data = f.read()
|
||||||
self.set_header('Content-type', 'image/jpeg')
|
#self.set_header('Content-type', 'image/jpeg')
|
||||||
self.write(data)
|
encoded = base64.b64encode(data)
|
||||||
|
print encoded
|
||||||
|
self.write(encoded)
|
||||||
self.finish()
|
self.finish()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
application = tornado.web.Application([
|
application = tornado.web.Application([
|
||||||
(r"/", MainHandler),
|
(r"/", MainHandler),
|
||||||
(r"/video", VideoHandler),
|
(r"/video", VideoHandler),
|
||||||
|
Reference in New Issue
Block a user