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

Discussion in 'Python' started by Ames Andreas (MPA/DF), Aug 6, 2004.

  1. 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
     
    Ames Andreas (MPA/DF), Aug 6, 2004
    #1
    1. Advertisements

  2. Ames Andreas (MPA/DF)

    Tim Roberts Guest

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

    "Ames Andreas (MPA/DF)" <> 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,
    Providenza & Boekelheide, Inc.
     
    Tim Roberts, Aug 8, 2004
    #2
    1. Advertisements

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Al Stoltz
    Replies:
    1
    Views:
    1,231
    Andrew Clover
    Jan 23, 2004
  2. Fred Murray

    Odd cgi.FieldStorage behavior

    Fred Murray, Mar 2, 2004, in forum: Python
    Replies:
    1
    Views:
    411
    Tim Roberts
    Mar 4, 2004
  3. python user

    libapreq2 and cgi.FieldStorage

    python user, Jul 9, 2004, in forum: Python
    Replies:
    0
    Views:
    444
    python user
    Jul 9, 2004
  4. Austyn Bontrager

    cgi.FieldStorage and REDIRECT_REQUEST_METHOD

    Austyn Bontrager, Jul 28, 2004, in forum: Python
    Replies:
    1
    Views:
    672
    Lee Harr
    Jul 28, 2004
  5. Ames Andreas (MPA/DF)
    Replies:
    0
    Views:
    452
    Ames Andreas (MPA/DF)
    Aug 5, 2004
  6. Ames Andreas (MPA/DF)

    [Q] Bug in cgi.FieldStorage?

    Ames Andreas (MPA/DF), Aug 20, 2004, in forum: Python
    Replies:
    1
    Views:
    474
    Tim Roberts
    Aug 22, 2004
  7. Neil Benn

    CGI, FieldStorage and Filename

    Neil Benn, Mar 30, 2005, in forum: Python
    Replies:
    0
    Views:
    451
    Neil Benn
    Mar 30, 2005
  8. elodie

    $sth->errstr; and $sth->execute;

    elodie, Nov 7, 2011, in forum: Perl Misc
    Replies:
    0
    Views:
    329
    elodie
    Nov 7, 2011
Loading...