web programming instances of fieldstorage are accessed like python dictionarywhere the keys are the field names on the form when accessed in this mannerthe objects returned are themselves an instance of fieldstorage for multipart data (content type is 'multipart/form-data'or file uploadsan instance of minifieldstorage for simple fields (content type is 'application/ -www-form-urlencoded')or list of such instances in cases where form contains multiple fields with the same name for exampleform cgi fieldstorage(if "namenot in formerror("name is missing"return name form['name'value email form['email'value get 'namefield from form get 'emailfield from form if field represents an uploaded fileaccessing the value attribute reads the entire file into memory as byte string because this may consume large amount of memory on the serverit may be preferable to read uploaded data in smaller pieces by reading from the file attribute directly for instancethe following example reads uploaded data line by linefileitem form['userfile'if fileitem fileit' an uploaded filecount lines linecount while trueline fileitem file readline(if not linebreak linecount linecount the following utility functions are often used in cgi scriptsescape( [quote]converts the characters '&''in string to html-safe sequences such as '&amp;''&lt;'and '&gt;if the optional flag quote is truethe double-quote character ("is also translated to '&quot;parse_header(stringparses the data supplied after an http header field such as 'content-typethe data is split into primary value and dictionary of secondary parameters that are returned in tuple for examplethe command parse_header('text/htmla=hellob="world"'returns this result('text/html'{' ':'hello'' ':'world'}parse_multipart(fppdictparse_multipart(fp,pdictparses input of type 'multipart/form-dataas is commonly used with file uploads fp is the input fileand pdict is dictionary containing parameters of the content-type header it returns dictionary mapping field names to lists of values this function doesn' work with nested multipart data the fieldstorage class should be used instead lib fl ff