From 8f73a84e4acf052ebb22493b697c7d13a3dff7a5 Mon Sep 17 00:00:00 2001 From: Marcelo Trylesinski Date: Thu, 4 Jun 2026 18:45:30 +0200 Subject: [PATCH] Describe actual UPLOAD_KEEP_FILENAME basename behavior in docstring --- python_multipart/multipart.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python_multipart/multipart.py b/python_multipart/multipart.py index 887cf60..d50e5b3 100644 --- a/python_multipart/multipart.py +++ b/python_multipart/multipart.py @@ -368,7 +368,7 @@ class File: |-----------------------|-------|---------|-------------| | 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_DELETE_TMP | `bool`| True | Delete automatically created TMP file | - | 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. | + | UPLOAD_KEEP_FILENAME | `bool`| False | Whether or not to keep the filename of the uploaded file. If True, then the filename is reduced to its basename (directory components are stripped) and the file is saved with that name. Otherwise, a temporary name will be used. | | 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. | | 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')`. |