class documentation

class FileUploadParser(BaseParser): (source)

View In Hierarchy

Parser for file upload data.

Method get_filename Detects the uploaded file name. First searches a 'filename' url kwarg. Then tries to parse Content-Disposition header.
Method parse Treats the incoming bytestream as a raw file upload and returns a `DataAndFiles` object.
Class Variable errors Undocumented
Class Variable media_type Undocumented
def get_filename(self, stream, media_type, parser_context): (source)

Detects the uploaded file name. First searches a 'filename' url kwarg. Then tries to parse Content-Disposition header.

def parse(self, stream, media_type=None, parser_context=None): (source)

Treats the incoming bytestream as a raw file upload and returns a `DataAndFiles` object. `.data` will be None (we expect request body to be a file content). `.files` will be a `QueryDict` containing one 'file' element.

Undocumented