473,327 Members | 1,892 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

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

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

Jul 18 '05 #1
1 1617
"Ames Andreas (MPA/DF)" <An**********@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, ti**@probo.com
Providenza & Boekelheide, Inc.
Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Fred Murray | last post by:
Hi all, When uploading a file ("input type=file"), FieldStorage usually behaves correctly, but every once in a while (every couple days?), it will suddenly start causing internal server errors. ...
0
by: Ames Andreas (MPA/DF) | last post by:
Hi, is it fair to assume that after executing the following code fs = cgi.FieldStorage(fp = somefile, keep_blank_values = 1) stream = fs.file or StringIO(fs.value) stream is a seekable copy...
1
by: Ames Andreas (MPA/DF) | last post by:
Hi, I'm currently using Zope 2.7.2-0 which in turn uses cgi.FieldStorage from Python 2.3.4. FieldStorage can either build a 'list' or a 'file' to represent a request. Unfortunately it...
0
by: Neil Benn | last post by:
Hello, I'm writing a simple cgi script and want to be able to access the filename in a FieldStorage file instance. I have successfully manmaged to access the file as a 'file-like object' by...
4
by: Derek Basch | last post by:
Given this FieldStorage object: FieldStorage(None, None, ) I am trying to cgi.urlencode the FieldStorage object to POST to another cgi script. The documentation for urlencode,...
3
by: Chris Curvey | last post by:
I can't be the first person to want to do this, but I also can't seem to find a solution. (Perhaps my Google skills are poor today.) How can I emulate cgi.FieldStorage() for my unit tests so that...
0
by: John Salerno | last post by:
I'm trying to use a for loop with a FieldStorage object and I get the following error. Can you not treat it like a dictionary, or am I writing the for loop incorrectly? for item in form: print...
7
by: John Salerno | last post by:
If I want to get all the values that are entered into an HTML form and write them to a file, is there some way to handle them all at the same time, or must FieldStorage be indexed by each specific...
4
by: arorap | last post by:
I've mod_php installed with Apache 2.2. In one of my folders, I'm using the cgihandler as the PythonHandler as my target host runs python only as CGI. Here cgi.FieldStorage() doesn't seem to work....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.