diff options
Diffstat (limited to 'docs/topics/http')
| -rw-r--r-- | docs/topics/http/file-uploads.txt | 44 |
1 files changed, 32 insertions, 12 deletions
diff --git a/docs/topics/http/file-uploads.txt b/docs/topics/http/file-uploads.txt index 54edd9e72d..6f7c5fbe83 100644 --- a/docs/topics/http/file-uploads.txt +++ b/docs/topics/http/file-uploads.txt @@ -122,25 +122,43 @@ Changing upload handler behavior Three settings control Django's file upload behavior: - ``FILE_UPLOAD_MAX_MEMORY_SIZE`` - The maximum size, in bytes, for files that will be uploaded - into memory. Files larger than ``FILE_UPLOAD_MAX_MEMORY_SIZE`` - will be streamed to disk. + :setting:`FILE_UPLOAD_MAX_MEMORY_SIZE` + The maximum size, in bytes, for files that will be uploaded into memory. + Files larger than :setting:`FILE_UPLOAD_MAX_MEMORY_SIZE` will be + streamed to disk. Defaults to 2.5 megabytes. - ``FILE_UPLOAD_TEMP_DIR`` - The directory where uploaded files larger than ``FILE_UPLOAD_TEMP_DIR`` - will be stored. + :setting:`FILE_UPLOAD_TEMP_DIR` + The directory where uploaded files larger than + :setting:`FILE_UPLOAD_TEMP_DIR` will be stored. Defaults to your system's standard temporary directory (i.e. ``/tmp`` on most Unix-like systems). + + :setting:`FILE_UPLOAD_PERMISSIONS` + The numeric mode (i.e. ``0644``) to set newly uploaded files to. For + more information about what these modes mean, see the `documentation for + os.chmod`_ + + If this isn't given or is ``None``, you'll get operating-system + dependent behavior. On most platforms, temporary files will have a mode + of ``0600``, and files saved from memory will be saved using the + system's standard umask. + + .. warning:: + + If you're not familiar with file modes, please note that the leading + ``0`` is very important: it indicates an octal number, which is the + way that modes must be specified. If you try to use ``644``, you'll + get totally incorrect behavior. + + **Always prefix the mode with a ``0``.** - ``FILE_UPLOAD_HANDLERS`` - The actual handlers for uploaded files. Changing this setting - allows complete customization -- even replacement -- of - Django's upload process. See `upload handlers`_, below, - for details. + :setting:`FILE_UPLOAD_HANDLERS` + The actual handlers for uploaded files. Changing this setting allows + complete customization -- even replacement -- of Django's upload + process. See `upload handlers`_, below, for details. Defaults to:: @@ -150,6 +168,8 @@ Three settings control Django's file upload behavior: Which means "try to upload to memory first, then fall back to temporary files." +.. _documentation for os.chmod: http://docs.python.org/lib/os-file-dir.html + ``UploadedFile`` objects ======================== |
