class_docstr: Used to create an upload button, when clicked allows a user to upload files that satisfy the specified file type or generic files (if file_type not set).
  Preprocessing: passes the uploaded file as a {file-object} or {List[file-object]} 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: upload_button
class_docstr_tok: ["Used","to","create","an","upload","button",",","when","clicked","allows","a","user","to","upload","files","that","satisfy","the","specified","file","type","or","generic","files","(","if","file_type","not","set",")",".","Preprocessing",":","passes","the","uploaded","file","as","a","{","file-object","}","or","{","List","[","file-object","]","}","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",":","upload_button"]
code: def _process_single_file(self, f: FileData) -> bytes | NamedString:
      file_name = f.path
      if self.type == "filepath":
          file = tempfile.NamedTemporaryFile(
              delete=False, dir=self.GRADIO_CACHE
          )
          file.name = file_name
          return NamedString(file_name)
      elif self.type == "binary":
          with open(file_name, "rb") as file_data:
              return file_data.read()
      else:
          raise ValueError(
              "Unknown type: "
              + str(type)
              + ". Please choose from: 'filepath', 'binary'."
          )
  
file_path: gradio/gradio/components/upload_button.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 4 for calling the UploadButton obj's underlying member method code with example usage: obj._process_single_file(f) and returns: NamedString, file_data