Ticket #23344: 23344.diff
File 23344.diff, 4.7 KB (added by , 10 years ago) |
---|
-
docs/ref/settings.txt
diff --git a/docs/ref/settings.txt b/docs/ref/settings.txt index 913f49f..e2b2f2d 100644
a b Default:: 1243 1243 ("django.core.files.uploadhandler.MemoryFileUploadHandler", 1244 1244 "django.core.files.uploadhandler.TemporaryFileUploadHandler") 1245 1245 1246 A tuple of handlers to use for uploading. See :doc:`/topics/files` for details. 1246 A tuple of handlers to use for uploading. Changing this setting allows complete 1247 customization -- even replacement -- of Django's upload process. 1248 1249 See :doc:`/topics/files` for details. 1247 1250 1248 1251 .. setting:: FILE_UPLOAD_MAX_MEMORY_SIZE 1249 1252 … … dependent behavior. On most platforms, temporary files will have a mode 1290 1293 of ``0o600``, and files saved from memory will be saved using the 1291 1294 system's standard umask. 1292 1295 1296 For security reasons, these permissions aren't applied to the temporary files 1297 that are stored in :setting:`FILE_UPLOAD_TEMP_DIR`. 1298 1293 1299 This setting also determines the default permissions for collected static files 1294 1300 when using the :djadmin:`collectstatic` management command. See 1295 1301 :djadmin:`collectstatic` for details on overriding it. … … when using the :djadmin:`collectstatic` management command. See 1303 1309 way that modes must be specified. If you try to use ``644``, you'll 1304 1310 get totally incorrect behavior. 1305 1311 1306 1307 1312 .. setting:: FILE_UPLOAD_TEMP_DIR 1308 1313 1309 1314 FILE_UPLOAD_TEMP_DIR … … FILE_UPLOAD_TEMP_DIR 1311 1316 1312 1317 Default: ``None`` 1313 1318 1314 The directory to store data temporarily while uploading files. If ``None``, 1315 Django will use the standard temporary directory for the operating system. For 1316 example, this will default to '/tmp' on \*nix-style operating systems. 1319 The directory to store data (typically files larger than 1320 :setting:`FILE_UPLOAD_MAX_MEMORY_SIZE`) temporarily while uploading files. 1321 If ``None``, Django will use the standard temporary directory for the operating 1322 system. For example, this will default to ``/tmp`` on \*nix-style operating 1323 systems. 1317 1324 1318 1325 See :doc:`/topics/files` for details. 1319 1326 … … Error reporting 2926 2933 * :setting:`MANAGERS` 2927 2934 * :setting:`SILENCED_SYSTEM_CHECKS` 2928 2935 2936 .. _file-upload-settings: 2937 2929 2938 File uploads 2930 2939 ------------ 2931 2940 * :setting:`DEFAULT_FILE_STORAGE` -
docs/topics/http/file-uploads.txt
diff --git a/docs/topics/http/file-uploads.txt b/docs/topics/http/file-uploads.txt index ea8c06d..f07c276 100644
a b defaults" which can be customized as described in the next section. 168 168 Changing upload handler behavior 169 169 -------------------------------- 170 170 171 There are a few settings which control Django's file upload behavior: 172 173 :setting:`FILE_UPLOAD_MAX_MEMORY_SIZE` 174 The maximum size, in bytes, for files that will be uploaded into memory. 175 Files larger than :setting:`FILE_UPLOAD_MAX_MEMORY_SIZE` will be 176 streamed to disk. 177 178 Defaults to 2.5 megabytes. 179 180 :setting:`FILE_UPLOAD_TEMP_DIR` 181 The directory where uploaded files larger than 182 :setting:`FILE_UPLOAD_MAX_MEMORY_SIZE` will be stored. 183 184 Defaults to your system's standard temporary directory (i.e. ``/tmp`` on 185 most Unix-like systems). 186 187 :setting:`FILE_UPLOAD_PERMISSIONS` 188 The numeric mode (i.e. ``0o644``) to set newly uploaded files to. For 189 more information about what these modes mean, see the documentation for 190 :func:`os.chmod`. 191 192 If this isn't given or is ``None``, you'll get operating-system 193 dependent behavior. On most platforms, temporary files will have a mode 194 of ``0o600``, and files saved from memory will be saved using the 195 system's standard umask. 196 197 For security reasons, these permissions aren't applied to the temporary 198 files that are stored in :setting:`FILE_UPLOAD_TEMP_DIR`. 199 200 .. warning:: 201 202 If you're not familiar with file modes, please note that the leading 203 ``0`` is very important: it indicates an octal number, which is the 204 way that modes must be specified. If you try to use ``644``, you'll 205 get totally incorrect behavior. 206 207 **Always prefix the mode with a 0.** 208 209 :setting:`FILE_UPLOAD_DIRECTORY_PERMISSIONS` 210 The numeric mode to apply to directories created in the process of 211 uploading files. This value mirrors the functionality and caveats of 212 the :setting:`FILE_UPLOAD_PERMISSIONS` setting. 213 214 :setting:`FILE_UPLOAD_HANDLERS` 215 The actual handlers for uploaded files. Changing this setting allows 216 complete customization -- even replacement -- of Django's upload 217 process. 171 There are a few settings which control Django's file upload behavior. See 172 :ref:`File Upload Settings <file-upload-settings>` for details. 218 173 219 174 Modifying upload handlers on the fly 220 175 ------------------------------------