Hi Folks,

I posted this question nearly a year ago and got no response.  I've
been living with awkward workarounds since, but it's becoming pretty
important for me to get a real solution to the problem, and am
wondering whether there's been any movement in the last year which
would mean someone now has any hints for me.  Would be very much
appreciated :)

......

I'm doing a multipart/related POST to my web.py server, and want to
be
able to get at the headers in the mime parts.  I haven't found a
comfortable way of handling multipart messages in web.py, perhaps
someone could give me some hints as to where to look?  I have an HTTP
request like this:

POST /server HTTP/1.1
Authorization: Basic ZGFmZnk6c2VjZXJldA==
Content-Length: nnn
Content-Type: multipart/related;
           boundary="===============0364140910==";
           type="application/atom+xml"
MIME-Version: 1.0
--===============0364140910==
Content-Type: application/atom+xml
MIME-Version: 1.0
Content-Disposition: attachment; name="atom"
<?xml version="1.0"?>
<entry xmlns="http://www.w3.org/2005/Atom";
         xmlns:dcterms="http://purl.org/dc/terms/";>
</entry>
--===============0364140910==
Content-Type: application/zip
MIME-Version: 1.0
Content-Disposition: attachment; name="payload";
filename="example.zip"
Content-Transfer-Encoding: base64
UEsDBBQAAAAIAESPTTc8cx/9sQYAAAEYAAAIABUAbWV0cy54bWxVVAkAAyD5EEch
+RBHVXgEAPU B
....
--===============0364140910==--

At the server end, I can access the content of the parts with:

webin = web.input()
atom = webin["atom"]
zip = webin["zip"]

But I've not been able to find out how to access any of the other
headers at the top of each mime part.

It seems like the Content-Disposition "name" parameter is used to
name
the dictionary indices in web.input() for each mime part's content.
I'd
like to get rid of the Content-Disposition header altogether and also
be
able to access the other headers.  I considered reading the message
in
with the email.mime package, but when I try to get the raw POST
request
body with web.data() the server just times out on it.

Any hints much appreciated.

Cheers,
Richard

-- 
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to webpy@googlegroups.com.
To unsubscribe from this group, send email to 
webpy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/webpy?hl=en.

Reply via email to