Tornado 大文件上传 stream_request_body

pylist 715

data_received 当数据块被接收后调用,chunk: 接收到的数据块。

@tornado.web.stream_request_body
class MainHandler(tornado.web.RequestHandler):
    def prepare(self):
        print self.request.headers

    def post(self):
        print 'POST successfully completed.'

    def data_received(self, chunk):
        print len(chunk)
您可能感兴趣的主题
登录发表评论