class documentation

class FileUploadHandler:

Known subclasses: django.core.files.uploadhandler.MemoryFileUploadHandler, django.core.files.uploadhandler.TemporaryFileUploadHandler

View In Hierarchy

Base class for streaming upload handlers.
Method file​_complete Signal that a file has completed. File size corresponds to the actual size accumulated by all the chunks.
Method handle​_raw​_input Handle the raw input from the client.
Method new​_file Signal that a new file has been started.
Method receive​_data​_chunk Receive data from the streamed upload parser. start is the position in the file of the chunk.
Method upload​_complete Signal that the upload is complete. Subclasses should perform cleanup that is necessary for this handler.
Method upload​_interrupted Signal that the upload was interrupted. Subclasses should perform cleanup that is necessary for this handler.
Class Variable chunk​_size Undocumented
Method __init__ Undocumented
Instance Variable charset Undocumented
Instance Variable content​_length Undocumented
Instance Variable content​_type Undocumented
Instance Variable content​_type​_extra Undocumented
Instance Variable field​_name Undocumented
Instance Variable file​_name Undocumented
Instance Variable request Undocumented
def file_complete(self, file_size):

Signal that a file has completed. File size corresponds to the actual size accumulated by all the chunks.

Subclasses should return a valid UploadedFile object.

def handle_raw_input(self, input_data, META, content_length, boundary, encoding=None):

Handle the raw input from the client.

Parameters:

Unknown Field: input_data
An object that supports reading via .read().
Unknown Field: meta
request.META.
Unknown Field: content_length
The (integer) value of the Content-Length header from the client.
Unknown Field: boundary
The boundary from the Content-Type header. Be sure to prepend two '--'.
def new_file(self, field_name, file_name, content_type, content_length, charset=None, content_type_extra=None):

Signal that a new file has been started.

Warning: As with any data from the client, you should not trust content_length (and sometimes won't even get it).

def receive_data_chunk(self, raw_data, start):
Receive data from the streamed upload parser. start is the position in the file of the chunk.
def upload_complete(self):
Signal that the upload is complete. Subclasses should perform cleanup that is necessary for this handler.
def upload_interrupted(self):
Signal that the upload was interrupted. Subclasses should perform cleanup that is necessary for this handler.
chunk_size =

Undocumented

def __init__(self, request=None):

Undocumented

charset =

Undocumented

content_length =

Undocumented

content_type =

Undocumented

content_type_extra =

Undocumented

field_name =

Undocumented

file_name =

Undocumented

request =

Undocumented