How to store input files on disk?

Hi, I spent hours trying to solve a basic this basic thing. How to store input files on diks?

the below does not work

def save(file):
  global df #used to access dataframe object  in jupyter notebook while debugging

  data = StringIO(s)
  return df

demo = gr.Interface(save, "file", "dataframe")

gives pandas.errors.EmptyDataError: No columns to parse from file white tying to upload a valid csv file

Gradio Docs is not helpful for saving files

    def save(files):
        for file in files:
            with open( as f:
                df = pd.read_csv(StringIO(
1 Like

Hi @dimadgo, is there a way to save the file buffer directly without exclusively reading it?