class documentation

class FileUpload(object):

View In Hierarchy

Undocumented

Method get​_header Return the value of a header within the mulripart part.
Method save Save file to disk or copy its content to an open file(-like) object. If destination is a directory, filename is added to the path. Existing files are not overwritten by default (IOError).
Class Variable content​_length Undocumented
Class Variable content​_type Undocumented
Instance Variable file Undocumented
Instance Variable headers Undocumented
Instance Variable name Undocumented
Instance Variable raw​_filename Undocumented
Method __init__ Wrapper for file uploads.
Method ​_copy​_file Undocumented
Property filename Name of the file on the client file system, but normalized to ensure file system compatibility. An empty filename is returned as 'empty'.
def get_header(self, name, default=None):
Return the value of a header within the mulripart part.
def save(self, destination, overwrite=False, chunk_size=2**16):
Save file to disk or copy its content to an open file(-like) object. If destination is a directory, filename is added to the path. Existing files are not overwritten by default (IOError).
Parameters
destinationFile path, directory or file(-like) object.
overwriteIf True, replace existing files. (default: False)
chunk​_sizeBytes to read at a time. (default: 64kb)
content_length =

Undocumented

content_type =

Undocumented

file =

Undocumented

headers =

Undocumented

name =

Undocumented

raw_filename =

Undocumented

def __init__(self, fileobj, name, filename, headers=None):
Wrapper for file uploads.
def _copy_file(self, fp, chunk_size=2**16):

Undocumented

@cached_property
filename =

Name of the file on the client file system, but normalized to ensure file system compatibility. An empty filename is returned as 'empty'.

Only ASCII letters, digits, dashes, underscores and dots are allowed in the final filename. Accents are removed, if possible. Whitespace is replaced by a single dash. Leading or tailing dots or dashes are removed. The filename is limited to 255 characters.