python cgi problem with method = post
and-google at doxdesk.com
Sun Oct 5 17:51:14 CEST 2003
phil <interstar at postmaster.co.uk> wrote:
> So I take it that the first call to FieldStorage wipes out the data
> for any subsequent calls? Is this right?
This is the case with CGI in general, not specifically a Python thing. A
POSTed form submission is sent in the body of the HTTP request, which is
the 'standard input' stream for the script. You can only read the contents
of a stream once. With the cgi module, this reading occurs when
FieldStorage is constructed, so trying to make more than one FieldStorage
is generally a mistake.
I don't know why this might have worked locally - it shouldn't!
mailto:and at doxdesk.com
More information about the Python-list