file and filename in cgi module? (newbie problem with Documentation)

Oleg Broytmann phd at phd.pp.ru
Thu May 23 04:34:56 EDT 2002


On Wed, May 22, 2002 at 04:54:25PM -0700, Bjoern wrote:
> fileitem = form["userfile"]
> if fileitem.file:
>      ..."
> 
> I wonder where does this .file thingy come from? I can't find anything
> about it in the documentation that comes with Python, and the same
> goes for filename. Is it specific to the cgi module? Are they
> attributes that all return values of FieldStorage-Entries have? But
> then why isn't there a descritpion of the FieldStorage class? By
> chance I found that .filename will give me the name of an uploaded
> file - where would have been the official place to read about it?

   The only reliable source of information is the source code.
Documentation (whether it is Python or not Python) never is as accurate and
complete as source code.

   In this aspect Python has two major advantages:

1. It is free software - you get all the source code with all your rights
to read, understand, use, etc.

2. Python is very readable language. Read the cgi.py file and enjoy!

Oleg.
-- 
     Oleg Broytmann            http://phd.pp.ru/            phd at phd.pp.ru
           Programmers don't die, they just GOSUB without RETURN.





More information about the Python-list mailing list