@@ -37,16 +37,24 @@ class FieldStorage:
37
37
filename: the filename, if specified; otherwise None;
38
38
this is the client side filename, *not* the file name on which
39
39
it is stored (that's a temporary file you don't deal with)
40
+
40
41
value: the value as a *string*; for file uploads, this transparently
41
42
reads the file every time you request the value and returns *bytes*
43
+
42
44
file: the file(-like) object from which you can read the data *as bytes*;
43
45
None if the data is stored a simple string
46
+
44
47
type: the content-type, or None if not specified
48
+
45
49
type_options: dictionary of options specified on the content-type line
50
+
46
51
disposition: content-disposition, or None if not specified
52
+
47
53
disposition_options: dictionary of corresponding options
54
+
48
55
headers: a dictionary(-like) object (sometimes email.message.Message
49
56
or a subclass thereof) containing *all* headers
57
+
50
58
The class can be subclassed, mostly for the purpose of overriding
51
59
the make_file() method, which is called internally to come up with
52
60
a file open for reading and writing. This makes it possible to
@@ -68,27 +76,36 @@ def __init__(self, fp=None, headers=None, outerboundary=b'',
68
76
"""Constructor. Read multipart/* until last part.
69
77
Arguments, all optional:
70
78
fp: file pointer; default: sys.stdin.buffer
79
+
71
80
Not used when the request method is GET.
72
81
Can be a TextIOWrapper object or an object whose read() and readline()
73
82
methods return bytes.
83
+
74
84
headers: header dictionary-like object;
75
85
default: taken from environ as per CGI spec
86
+
76
87
outerboundary: terminating multipart boundary (for internal use only)
88
+
77
89
environ: environment dictionary; default: os.environ
90
+
78
91
keep_blank_values: flag indicating whether blank values in
79
92
percent-encoded forms should be treated as blank strings.
80
93
A true value indicates that blanks should be retained as blank strings.
81
94
The default false value indicates that blank values are to be ignored
82
95
and treated as if they were not included.
96
+
83
97
strict_parsing: flag indicating what to do with parsing errors.
84
98
If false (the default), errors are silently ignored.
85
99
If true, errors raise a ValueError exception.
100
+
86
101
limit: used internally to read parts of multipart/form-data forms,
87
102
to exit from the reading loop when reached. It is the difference
88
- between the form content-length and the number of bytes already read
103
+ between the form content-length and the number of bytes already read.
104
+
89
105
encoding, errors: the encoding and error handler used to decode the
90
106
binary stream to strings. Must be the same as the charset defined for
91
107
the page sending the form (content-type : meta http-equiv or header)
108
+
92
109
max_num_fields: int. If set, then __init__ throws a ValueError if
93
110
there are more than n fields read by parse_qsl().
94
111
"""
0 commit comments