Python - What type is flask.request.files.stream supposed to be?

馋奶兔 提交于 2019-12-01 09:22:42

Files smaller than 1024 * 500 bytes are written to a StringIO object, while files greater than that threshold are written to temporary files.

It's part of Werkzeug's testing framework, but that function isn't part of the online documentation:

def stream_encode_multipart(values, use_tempfile=True, threshold=1024 * 500,
                            boundary=None, charset='utf-8'):
    """Encode a dict of values (either strings or file descriptors or
    :class:`FileStorage` objects.) into a multipart encoded string stored
    in a file descriptor.
    """

    ...

Source

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!