Welcome on my personal web page

Tornado: upload multipart/form-data including both file and JSON data

Tornado: upload multipart/form-data including both file and JSON data

Using Tornado as a web server, you can receive a Form composed of multiple items including both file and JSON data.

        file_dic = {}

        arg_dic = {}

        httputil.parse_body_arguments(self.request.headers["Content-Type"], self.request.body, arg_dic, file_dic)

        logger.debug("args={}".format(arg_dic))

        logger.debug("files={}".format(file_dic))