Class
cgi.FieldStorage

Store a sequence of fields, reading multipart/form-data.

This class provides naming, typing, files stored on disk, and more. At the top level, it is accessible like a dictionary, whose keys are the field names. (Note: None can occur as a field name.) The items are either a Python list (if there's multiple values) or another FieldStorage or MiniFieldStorage object. If it's a single object, it has the following attributes:

name: the field name, if specified; otherwise None

filename: the filename, if specified; otherwise None; this is the client side filename, not the file name on which it is stored (that's a temporary file you don't deal with)

value: the value as a string; for file uploads, this transparently reads the file every time you request the value

file: the file(-like) object from which you can read the data; None if the data is stored a simple string

type: the content-type, or None if not specified

type_options: dictionary of options specified on the content-type line

disposition: content-disposition, or None if not specified

disposition_options: dictionary of corresponding options

headers: a dictionary(-like) object (sometimes rfc822.Message or a subclass thereof) containing all headers

The class is subclassable, mostly for the purpose of overriding the make_file() method, which is called internally to come up with a file open for reading and writing. This makes it possible to override the default choice of storing all files in a temporary directory and unlinking them as soon as they have been opened.

Base classes

There are no base classes.

Implemented Interfaces

There are no implemented interfaces.

Attributes/Properties

Methods

Known Subclasses