q about cgi.FieldStorage (was: And now to sth. completely

  • Thread starter Ames Andreas (MPA/DF)
  • Start date
A

Ames Andreas (MPA/DF)

Hi,

sorry for following-up to myself. Some remarks:

1) Please excuse the bogus original message. I wrote it a minute
before I knocked off work and I promise to never do so again :)

2) What I really wanted to know was: FieldStorage writes what it
reads from the stream that is given to its constructor's fp (or
sys.stdin by default) to a temporary file only _in some cases_. My
question was or rather should have been, if it was possible in any
case to get what FieldStorage has read from its input stream either
as a string or as a file.

3) After staring at FieldStorage's source code for some time now I
seem to be sure that this isn't possible because the input stream
is read to a local variable in some cases, i. e. when the request
is url-encoded.


cheers,

andreas
 
T

Tim Roberts

Ames Andreas (MPA/DF) said:
1) Please excuse the bogus original message. I wrote it a minute
before I knocked off work and I promise to never do so again :)

2) What I really wanted to know was: FieldStorage writes what it
reads from the stream that is given to its constructor's fp (or
sys.stdin by default) to a temporary file only _in some cases_. My
question was or rather should have been, if it was possible in any
case to get what FieldStorage has read from its input stream either
as a string or as a file.

Not in its raw form. The stream comes from Apache and evaporates as it is
read. If you need to raw data, just forget about cgi.FieldStorage and read
stdin directly. You can always copy it to a temp file or StringIO and feed
it back to the cgi module later.
 

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

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top