File upload with Tornado File upload with Tornado python-3.x python-3.x

File upload with Tornado


self.request.files should be fine. Here is an example.


@require_basic_authclass UploadFile(tornado.web.RequestHandler):    def put(self, params):        path = calculate_path(params)        with open(path, 'wb') as out:            body = self.request.get_argument('data')            out.write(bytes(body, 'utf8'))        

...was what I needed.

Found on some ActiveState pages.