Mod python with multipart

G

Gandalf

Hi All!

Does anyone know how to read the "multipart/form-data" posted by a form?
I'm using mod_python 3.1 and Apache 2.
I looked at the docs of the request object but there is no description
on how to read multipart data.
I also tried google with "modpython multipart" but there are only a few
hits - I could not use them.

I only need the multipart data as a string - I have already written the
code that splits the data into fielts.
Thanks in advance,

Laci
 
B

Benjamin Niemann

Does anyone know how to read the "multipart/form-data" posted by a form?
I'm using mod_python 3.1 and Apache 2.
I looked at the docs of the request object but there is no description
on how to read multipart data.
I also tried google with "modpython multipart" but there are only a few
hits - I could not use them.
this is a question for the mod_python ML, but anyway ;)
I'm using

data = cgi.FieldStorage(fp=req,
headers=req.headers_in,
keep_blank_values=True,
environ={'REQUEST_METHOD':'POST'})

which works fine for me. Later I've seen that mod_python has it's own
implementation of FieldStorage, but I have not tried it yet.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top