q about cgi.FieldStorage (was: And now to sth. completely different: Forget about decorators, think cgi.FieldStorage)

Tim Roberts timr at probo.com
Sun Aug 8 07:20:31 CEST 2004

"Ames Andreas (MPA/DF)" <Andreas.Ames at tenovis.com> wrote:
>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.
- Tim Roberts, timr at probo.com
  Providenza & Boekelheide, Inc.

More information about the Python-list mailing list