<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>Hello All,</p>
<p>You can find a sample HTTP POST request using HTTP multipart/form-data at the end of this message.</p>
<p>The server that handles this request is using twisted so I end up with a Request object. Is there a way I can extract the file name ("image008.jpg") from this stream? I'm looking at the source of cgi.parse_multipart() and it seems to be ignored.</p>
<p>Best regards
Burak
</p>
PS:<br>
<pre class="source ">POST /put HTTP/1.1
Host: localhost:7111
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:48.0) Gecko/20100101 Firefox/48.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Type: multipart/form-data; boundary=---------------------------352471062160373366296932264
Content-Length: 382691
-----------------------------352471062160373366296932264
Content-Disposition: form-data; name="name"
a
-----------------------------352471062160373366296932264
Content-Disposition: form-data; name="version"
1
-----------------------------352471062160373366296932264
Content-Disposition: form-data; name="data"; filename="image008.jpg"
Content-Type: image/jpeg
(...)
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><style type="text/css">
p, li { white-space: pre-wrap; }
</style></pre></body></html>