Django

Code

Show
Ignore:
Timestamp:
07/01/08 10:10:51 (2 months ago)
Author:
jacob
Message:

Fixed #2070: refactored Django's file upload capabilities.

A description of the new features can be found in the new upload handling documentation; the executive summary is that Django will now happily handle uploads of large files without issues.

This changes the representation of uploaded files from dictionaries to bona fide objects; see BackwardsIncompatibleChanges for details.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/conf/global_settings.py

    r7698 r7814  
    232232MEDIA_URL = '' 
    233233 
     234# List of upload handler classes to be applied in order. 
     235FILE_UPLOAD_HANDLERS = ( 
     236    'django.core.files.uploadhandler.MemoryFileUploadHandler', 
     237    'django.core.files.uploadhandler.TemporaryFileUploadHandler', 
     238) 
     239 
     240# Maximum size, in bytes, of a request before it will be streamed to the 
     241# file system instead of into memory. 
     242FILE_UPLOAD_MAX_MEMORY_SIZE = 2621440 # i.e. 2.5 MB 
     243 
     244# Directory in which upload streamed files will be temporarily saved. A value of 
     245# `None` will make Django use the operating system's default temporary directory 
     246# (i.e. "/tmp" on *nix systems). 
     247FILE_UPLOAD_TEMP_DIR = None 
     248 
    234249# Default formatting for date objects. See all available format strings here: 
    235250# http://www.djangoproject.com/documentation/templates/#now