Allow other users to upload a file to my notebook


I have a small notebook plotting data series and would like other users to be able to upload a CSV with their data and visualise it together with mine. But I would like this to be simple, i.e. without forcing them to attach the file and write a line of code. Is this possible with some coding?


You can add a file input to your notebook that lets users select a file from disk so that your notebook code can access and process the file’s contents:

viewof myData = Inputs.file({accept: ".csv"})
  const data = await myData.csv();
  // Do something with the data, e.g. returning a table.
  return Inputs.table(data);

Note that this won’t upload any data - all processing happens locally in the user’s browser.

Thanks, I’ll try it.