Ticket #23344: 23344.diff

File 23344.diff, 4.7 KB (added by Tim Graham, 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::  
    12431243    ("django.core.files.uploadhandler.MemoryFileUploadHandler",
    12441244     "django.core.files.uploadhandler.TemporaryFileUploadHandler")
    12451245
    1246 A tuple of handlers to use for uploading. See :doc:`/topics/files` for details.
     1246A tuple of handlers to use for uploading. Changing this setting allows complete
     1247customization -- even replacement -- of Django's upload process.
     1248
     1249See :doc:`/topics/files` for details.
    12471250
    12481251.. setting:: FILE_UPLOAD_MAX_MEMORY_SIZE
    12491252
    dependent behavior. On most platforms, temporary files will have a mode  
    12901293of ``0o600``, and files saved from memory will be saved using the
    12911294system's standard umask.
    12921295
     1296For security reasons, these permissions aren't applied to the temporary files
     1297that are stored in :setting:`FILE_UPLOAD_TEMP_DIR`.
     1298
    12931299This setting also determines the default permissions for collected static files
    12941300when using the :djadmin:`collectstatic` management command. See
    12951301:djadmin:`collectstatic` for details on overriding it.
    when using the :djadmin:`collectstatic` management command. See  
    13031309    way that modes must be specified. If you try to use ``644``, you'll
    13041310    get totally incorrect behavior.
    13051311
    1306 
    13071312.. setting:: FILE_UPLOAD_TEMP_DIR
    13081313
    13091314FILE_UPLOAD_TEMP_DIR
    FILE_UPLOAD_TEMP_DIR  
    13111316
    13121317Default: ``None``
    13131318
    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.
     1319The directory to store data (typically files larger than
     1320:setting:`FILE_UPLOAD_MAX_MEMORY_SIZE`) temporarily while uploading files.
     1321If ``None``, Django will use the standard temporary directory for the operating
     1322system. For example, this will default to ``/tmp`` on \*nix-style operating
     1323systems.
    13171324
    13181325See :doc:`/topics/files` for details.
    13191326
    Error reporting  
    29262933* :setting:`MANAGERS`
    29272934* :setting:`SILENCED_SYSTEM_CHECKS`
    29282935
     2936.. _file-upload-settings:
     2937
    29292938File uploads
    29302939------------
    29312940* :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.  
    168168Changing upload handler behavior
    169169--------------------------------
    170170
    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.
     171There are a few settings which control Django's file upload behavior. See
     172:ref:`File Upload Settings <file-upload-settings>` for details.
    218173
    219174Modifying upload handlers on the fly
    220175------------------------------------
Back to Top