@_with_element
def file_uploader(self, element, label, type=None, encoding='auto', key=None):
    'Display a file uploader widget.\n\n        By default, uploaded files are limited to 200MB. You can configure\n        this using the `server.maxUploadSize` config option.\n\n        Parameters\n        ----------\n        label : str or None\n            A short label explaining to the user what this file uploader is for.\n        type : str or list of str or None\n            Array of allowed extensions. [\'png\', \'jpg\']\n            By default, all extensions are allowed.\n        encoding : str or None\n            The encoding to use when opening textual files (i.e. non-binary).\n            For example: \'utf-8\'. If set to \'auto\', will try to guess the\n            encoding. If None, will assume the file is binary.\n        key : str\n            An optional string to use as the unique key for the widget.\n            If this is omitted, a key will be generated for the widget\n            based on its content. Multiple widgets of the same type may\n            not share the same key.\n\n        Returns\n        -------\n        BytesIO or StringIO or or list of BytesIO/StringIO or None\n            If no file has been uploaded, returns None. Otherwise, returns\n            the data for the uploaded file(s):\n            - If the file is in a well-known textual format (or if the encoding\n            parameter is set), the file data is a StringIO.\n            - Otherwise the file data is BytesIO.\n            - If multiple_files is True, a list of file data will be returned.\n\n            Note that BytesIO/StringIO are "file-like", which means you can\n            pass them anywhere where a file is expected!\n\n        Examples\n        --------\n        >>> uploaded_file = st.file_uploader("Choose a CSV file", type="csv")\n        >>> if uploaded_file is not None:\n        ...     data = pd.read_csv(uploaded_file)\n        ...     st.write(data)\n\n        '
    accept_multiple_files = False
    if isinstance(type, str):
        type = [type]
    element.file_uploader.label = label
    element.file_uploader.type[:] = (type if (type is not None) else [])
    element.file_uploader.max_upload_size_mb = config.get_option('server.maxUploadSize')
    element.file_uploader.multiple_files = accept_multiple_files
    _set_widget_id('file_uploader', element, user_key=key)
    files = None
    ctx = get_report_ctx()
    if (ctx is not None):
        files = ctx.uploaded_file_mgr.get_files(session_id=ctx.session_id, widget_id=element.file_uploader.id)
    if (files is None):
        return NoValue
    file_datas = [get_encoded_file_data(file.data, encoding) for file in files]
    return (file_datas if accept_multiple_files else file_datas[0])
Display a file uploader widget.

By default, uploaded files are limited to 200MB. You can configure
this using the `server.maxUploadSize` config option.

Parameters
----------
label : str or None
    A short label explaining to the user what this file uploader is for.
type : str or list of str or None
    Array of allowed extensions. ['png', 'jpg']
    By default, all extensions are allowed.
encoding : str or None
    The encoding to use when opening textual files (i.e. non-binary).
    For example: 'utf-8'. If set to 'auto', will try to guess the
    encoding. If None, will assume the file is binary.
key : str
    An optional string to use as the unique key for the widget.
    If this is omitted, a key will be generated for the widget
    based on its content. Multiple widgets of the same type may
    not share the same key.

Returns
-------
BytesIO or StringIO or or list of BytesIO/StringIO or None
    If no file has been uploaded, returns None. Otherwise, returns
    the data for the uploaded file(s):
    - If the file is in a well-known textual format (or if the encoding
    parameter is set), the file data is a StringIO.
    - Otherwise the file data is BytesIO.
    - If multiple_files is True, a list of file data will be returned.

    Note that BytesIO/StringIO are "file-like", which means you can
    pass them anywhere where a file is expected!

Examples
--------
>>> uploaded_file = st.file_uploader("Choose a CSV file", type="csv")
>>> if uploaded_file is not None:
...     data = pd.read_csv(uploaded_file)
...     st.write(data)
@_with_element
def file_uploader(self, element, label, type=None, encoding='auto', key=None):
    'Display a file uploader widget.\n\n        By default, uploaded files are limited to 200MB. You can configure\n        this using the `server.maxUploadSize` config option.\n\n        Parameters\n        ----------\n        label : str or None\n            A short label explaining to the user what this file uploader is for.\n        type : str or list of str or None\n            Array of allowed extensions. [\'png\', \'jpg\']\n            By default, all extensions are allowed.\n        encoding : str or None\n            The encoding to use when opening textual files (i.e. non-binary).\n            For example: \'utf-8\'. If set to \'auto\', will try to guess the\n            encoding. If None, will assume the file is binary.\n        key : str\n            An optional string to use as the unique key for the widget.\n            If this is omitted, a key will be generated for the widget\n            based on its content. Multiple widgets of the same type may\n            not share the same key.\n\n        Returns\n        -------\n        BytesIO or StringIO or or list of BytesIO/StringIO or None\n            If no file has been uploaded, returns None. Otherwise, returns\n            the data for the uploaded file(s):\n            - If the file is in a well-known textual format (or if the encoding\n            parameter is set), the file data is a StringIO.\n            - Otherwise the file data is BytesIO.\n            - If multiple_files is True, a list of file data will be returned.\n\n            Note that BytesIO/StringIO are "file-like", which means you can\n            pass them anywhere where a file is expected!\n\n        Examples\n        --------\n        >>> uploaded_file = st.file_uploader("Choose a CSV file", type="csv")\n        >>> if uploaded_file is not None:\n        ...     data = pd.read_csv(uploaded_file)\n        ...     st.write(data)\n\n        '
    accept_multiple_files = False
    if isinstance(type, str):
        type = [type]
    element.file_uploader.label = label
    element.file_uploader.type[:] = (type if (type is not None) else [])
    element.file_uploader.max_upload_size_mb = config.get_option('server.maxUploadSize')
    element.file_uploader.multiple_files = accept_multiple_files
    _set_widget_id('file_uploader', element, user_key=key)
    files = None
    ctx = get_report_ctx()
    if (ctx is not None):
        files = ctx.uploaded_file_mgr.get_files(session_id=ctx.session_id, widget_id=element.file_uploader.id)
    if (files is None):
        return NoValue
    file_datas = [get_encoded_file_data(file.data, encoding) for file in files]
    return (file_datas if accept_multiple_files else file_datas[0])