You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| UPLOAD_DIR | `str` | None | The directory to store uploaded files in. If this is None, a temporary file will be created in the system's standard location. |
| UPLOAD_KEEP_FILENAME | `bool`| False | Whether or not to keep the filename of the uploaded file. If True, then the filename will be converted to a safe representation (e.g. by removing any invalid path segments), and then saved with the same name). Otherwise, a temporary name will be used. |
330
+
| UPLOAD_KEEP_EXTENSIONS| `bool`| False | Whether or not to keep the uploaded file's extension. If False, the file will be saved with the default temporary extension (usually ".tmp"). Otherwise, the file's extension will be maintained. Note that this will properly combine with the UPLOAD_KEEP_FILENAME setting. |
331
+
| MAX_MEMORY_FILE_SIZE | `int` | 1 MiB | The maximum number of bytes of a File to keep in memory. By default, the contents of a File are kept into memory until a certain limit is reached, after which the contents of the File are written to a temporary file. This behavior can be disabled by setting this value to an appropriately large value (or, for example, infinity, such as `float('inf')`. |
366
332
367
333
:param file_name: The name of the file that this :class:`File` represents
368
334
@@ -372,7 +338,7 @@ class File:
372
338
373
339
:param config: The configuration for this File. See above for valid
374
340
configuration keys and their corresponding values.
| on_part_begin | None | Called when a new part of the multipart message is encountered. |
956
+
| on_part_data | data, start, end| Called when a portion of a part's data is encountered. |
957
+
| on_part_end | None | Called when the end of a part is reached. |
958
+
| on_header_begin | None | Called when we've found a new header in a part of a multipart message |
959
+
| on_header_field | data, start, end| Called each time an additional portion of a header is read (i.e. the part of the header that is before the colon; the "Foo" in "Foo: Bar"). |
960
+
| on_header_value | data, start, end| Called when we get data for a header. |
961
+
| on_header_end | None | Called when the current header is finished - i.e. we've reached the newline at the end of the header. |
962
+
| on_headers_finished| None | Called when all headers are finished, and before the part data starts. |
963
+
| on_end | None | Called when the parser is finished parsing all data. |
1042
964
1043
965
:param boundary: The multipart boundary. This is required, and must match
1044
966
what is given in the HTTP request - usually in the
@@ -1049,7 +971,7 @@ class MultipartParser(BaseParser):
1049
971
1050
972
:param max_size: The maximum size of body to parse. Defaults to infinity -
0 commit comments