OpenQuizz
Une application de gestion des contenus pédagogiques
|
Public Member Functions | |
def | __init__ (self, stream=None, filename=None, name=None, content_type=None, content_length=None, headers=None) |
def | content_type (self) |
def | content_length (self) |
def | mimetype (self) |
def | mimetype_params (self) |
def | save (self, dst, buffer_size=16384) |
def | close (self) |
def | __nonzero__ (self) |
def | __getattr__ (self, name) |
def | __iter__ (self) |
def | __repr__ (self) |
Data Fields | |
name | |
stream | |
filename | |
headers | |
The :class:`FileStorage` class is a thin wrapper over incoming files. It is used by the request object to represent uploaded files. All the attributes of the wrapper stream are proxied by the file storage so it's possible to do ``storage.read()`` instead of the long form ``storage.stream.read()``.
def __init__ | ( | self, | |
stream = None , |
|||
filename = None , |
|||
name = None , |
|||
content_type = None , |
|||
content_length = None , |
|||
headers = None |
|||
) |
def __getattr__ | ( | self, | |
name | |||
) |
def __iter__ | ( | self | ) |
def __nonzero__ | ( | self | ) |
def __repr__ | ( | self | ) |
def close | ( | self | ) |
Close the underlying file if possible.
def content_length | ( | self | ) |
The content-length sent in the header. Usually not available
def content_type | ( | self | ) |
The content-type sent in the header. Usually not available
def mimetype | ( | self | ) |
Like :attr:`content_type`, but without parameters (eg, without charset, type etc.) and always lowercase. For example if the content type is ``text/HTML; charset=utf-8`` the mimetype would be ``'text/html'``. .. versionadded:: 0.7
def mimetype_params | ( | self | ) |
The mimetype parameters as dict. For example if the content type is ``text/html; charset=utf-8`` the params would be ``{'charset': 'utf-8'}``. .. versionadded:: 0.7
def save | ( | self, | |
dst, | |||
buffer_size = 16384 |
|||
) |
Save the file to a destination path or file object. If the destination is a file object you have to close it yourself after the call. The buffer size is the number of bytes held in memory during the copy process. It defaults to 16KB. For secure file saving also have a look at :func:`secure_filename`. :param dst: a filename, :class:`os.PathLike`, or open file object to write to. :param buffer_size: Passed as the ``length`` parameter of :func:`shutil.copyfileobj`. .. versionchanged:: 1.0 Supports :mod:`pathlib`.
filename |
headers |
name |
stream |