class_docstr: Creates a file component that allows uploading generic file (when used as an input) and or displaying generic files (output).
  Preprocessing: passes the uploaded file as a {tempfile._TemporaryFileWrapper} or {List[tempfile._TemporaryFileWrapper]} depending on `file_count` (or a {bytes}/{List[bytes]} depending on `type`)
  Postprocessing: expects function to return a {str} path to a file, or {List[str]} consisting of paths to files.
  Examples-format: a {str} path to a local file that populates the component.
  Demos: zip_to_json, zip_files
class_docstr_tok: ["Creates","a","file","component","that","allows","uploading","generic","file","(","when","used","as","an","input",")","and","or","displaying","generic","files","(","output",")",".","Preprocessing",":","passes","the","uploaded","file","as","a","{","tempfile._TemporaryFileWrapper","}","or","{","List","[","tempfile._TemporaryFileWrapper","]","}","depending","on","`","file_count","`","(","or","a","{","bytes","}","\/","{","List","[","bytes","]","}","depending","on","`","type","`",")","Postprocessing",":","expects","function","to","return","a","{","str","}","path","to","a","file",",","or","{","List","[","str","]","}","consisting","of","paths","to","files",".","Examples-format",":","a","{","str","}","path","to","a","local","file","that","populates","the","component",".","Demos",":","zip_to_json",",","zip_files"]
code: def preprocess(
      self, payload: ListFiles | FileData | None
  ) -> bytes | NamedString | list[bytes | NamedString] | None:
      if payload is None:
          return None
      if self.file_count == "single":
          if isinstance(payload, ListFiles):
              return self._process_single_file(payload[0])
          else:
              return self._process_single_file(payload)
      else:
          if isinstance(payload, ListFiles):
              return [self._process_single_file(f) for f in payload]
          else:
              return [self._process_single_file(payload)]
  
file_path: gradio/gradio/components/file.py
imports: from __future__ import annotations
  import tempfile
  import warnings
  from pathlib import Path
  from typing import Any, Callable, Literal
  from gradio_client.documentation import document, set_documentation_group
  from gradio.components.base import Component
  from gradio.data_classes import FileData, ListFiles
  from gradio.events import Events
  from gradio.utils import NamedString
label_desc: Use image node_id 3 for calling the File obj's underlying member method code with example usage: obj.preprocess(payload) and returns: None, self, self, unknown, list