Ticket #8454: 8454.diff
File 8454.diff, 2.1 KB (added by , 16 years ago) |
---|
-
django/conf/global_settings.py
252 252 # (i.e. "/tmp" on *nix systems). 253 253 FILE_UPLOAD_TEMP_DIR = None 254 254 255 # The numeric mode to set newly-uploaded files to. See the chmod function here: 256 # http://docs.python.org/lib/os-file-dir.html 257 FILE_UPLOAD_PERMISSIONS = None 258 255 259 # Default formatting for date objects. See all available format strings here: 256 260 # http://www.djangoproject.com/documentation/templates/#now 257 261 DATE_FORMAT = 'N j, Y' -
django/core/files/storage.py
168 168 else: 169 169 # OK, the file save worked. Break out of the loop. 170 170 break 171 171 172 # Since it's possible that temporary files and in-memory saved files will end up 173 # with different permissions, allow for a common way of setting them. 174 if settings.FILE_UPLOAD_PERMISSIONS is not None: 175 os.chmod( full_path, settings.FILE_UPLOAD_PERMISSIONS ) 176 172 177 return name 173 178 174 179 def delete(self, name): -
docs/upload_handling.txt
150 150 Which means "try to upload to memory first, then fall back to temporary 151 151 files." 152 152 153 ``FILE_UPLOAD_PERMISSIONS`` 154 The numeric mode (e.g. ``0644``) to set newly-uploaded files to. 155 156 If this is not specified, temporary files will be created with a mode of 157 ``0600``, while files saved to disk from memory will respect the current 158 umask value. 159 160 See the `documentation for chmod`_ for a list of mode bits. 161 153 162 .. _settings: ../settings/ 163 .. _documentation for chmod: http://docs.python.org/lib/os-file-dir.html 154 164 155 165 ``UploadedFile`` objects 156 166 ========================