class FileStorage: (source)
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()``.
Method | __bool__ |
Undocumented |
Method | __getattr__ |
Undocumented |
Method | __init__ |
Undocumented |
Method | __iter__ |
Undocumented |
Method | __repr__ |
Undocumented |
Method | close |
Close the underlying file if possible. |
Method | save |
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... |
Instance Variable | filename |
Undocumented |
Instance Variable | headers |
Undocumented |
Instance Variable | name |
Undocumented |
Instance Variable | stream |
Undocumented |
Property | content |
The content-length sent in the header. Usually not available |
Property | content |
The content-type sent in the header. Usually not available |
Property | mimetype |
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'``. |
Property | mimetype |
The mimetype parameters as dict. For example if the content type is ``text/html; charset=utf-8`` the params would be ``{'charset': 'utf-8'}``. |
Method | _parse |
Undocumented |
Instance Variable | _parsed |
Undocumented |
Undocumented
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`.
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