471,830 Members | 1,522 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,830 software developers and data experts.

Looking for cookbook/recipe generating multipart web data

My web server (apache+mod_python) needs to reply on some session with a multipart connection.
My idea is to use the content-type of multipart/mixed; boundary=--myboundary

The data that I would like to send is a continuous stream of data, divided by that boundary.
Well, there are tons of examples on the web how to encode such a stream on the client side, but I can't find an example how to generate this data using mod_python.

So for now in the very simple example, my code looks like:

req.content_type("multipart/mixed; boundary=--myboundary")
while forever:
data = "--myboudary\r\n%s" % getData()

However, for every req.write, len(data) + lfcr + boundary/data + lfcr is send out and I just want to send boudary/data like I see in existing applications on the web and described in the w3 norms of multipart.

What is the correct way of doing this? Where can I find the proper cookbook?


Jul 18 '05 #1
0 1064

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Ringwraith | last post: by
2 posts views Thread by Will McGugan | last post: by
reply views Thread by TechBookReport | last post: by
reply views Thread by Frederick Noronha \(FN\) | last post: by
3 posts views Thread by Steve Howell | last post: by
9 posts views Thread by Alex Popescu | last post: by
reply views Thread by NeoPa | last post: by
reply views Thread by YellowAndGreen | last post: by
reply views Thread by aboka | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.