I receive a Response from the server with the next body:

body='------WebKitFormBoundarylY6hpxLHtLTD33AY\r\nContent-Disposition: form-data; name="file"; filename="language.py"\r\nContent-Type: text/x-python-script\r\n\r\n#!/usr/bin/env python\n
.....
.....
\r\n------WebKitFormBoundarylY6hpxLHtLTD33AY--\r\n'

And I want to parse this body and extract, name, filename, content-type and the full content of the file for storing. May Be possible? Thanks in advance.

有帮助吗?

解决方案

Tornado should parse this for you; the contents will be available in self.request.files. http://www.tornadoweb.org/en/stable/httpserver.html#tornado.httpserver.HTTPRequest.files

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top