1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16:09 +00:00

Fixed #35326 -- Added allow_overwrite parameter to FileSystemStorage.

This commit is contained in:
Ben Cail
2024-03-26 11:25:29 -04:00
committed by Sarah Boyce
parent 6c48eed238
commit 0b33a3abc2
5 changed files with 157 additions and 15 deletions

View File

@@ -28,7 +28,7 @@ Django provides convenient ways to access the default storage class:
The ``FileSystemStorage`` class
===============================
.. class:: FileSystemStorage(location=None, base_url=None, file_permissions_mode=None, directory_permissions_mode=None)
.. class:: FileSystemStorage(location=None, base_url=None, file_permissions_mode=None, directory_permissions_mode=None, allow_overwrite=False)
The :class:`~django.core.files.storage.FileSystemStorage` class implements
basic file storage on a local filesystem. It inherits from
@@ -60,6 +60,13 @@ The ``FileSystemStorage`` class
The file system permissions that the directory will receive when it is
saved. Defaults to :setting:`FILE_UPLOAD_DIRECTORY_PERMISSIONS`.
.. attribute:: allow_overwrite
.. versionadded:: 5.1
Flag to control allowing saving a new file over an existing one.
Defaults to ``False``.
.. method:: get_created_time(name)
Returns a :class:`~datetime.datetime` of the system's ctime, i.e.