fileupload error!

Emile van Sebille emile at fenx.com
Sat Jun 15 10:22:09 EDT 2002


penguin
> Hi I try to upload a picture with a python cgi script. Tried many
versions of the code, this is the current.
> Here's the code and error!
>
> The error:
>
> Traceback (most recent call last): File "C:\cgi-bin\upload.py", line
179,
> in ? xmldokument = skjema['dok'].value File "C:\Python22\lib\cgi.py",
line
> 550, in __getitem__ raise KeyError, key KeyError: dok
>

I didn't read through your code, but the error you're getting means that
'doc' is not a key in cgi.FieldStorage().

skjema = cgi.FieldStorage()
xmldokument = skjema['dok'].value


There are many discussions and examples of cgi module usage at:

http://groups.google.com/groups?as_q=cgi.FieldStorage&as_ugroup=comp.lan
g.python


HTH,


--

Emile van Sebille
emile at fenx.com

---------




More information about the Python-list mailing list