9.1 File uploads

9.1.1 UI

To upload a file use fileInput(id, label).

Some other arguments are:

  • multiple - can multiple files be uploaded at once?
  • accept - what file types are accepted? (character vector)
    • file extension: .csv, .tsv, .rds
    • MIME type: application/JSON, image/png
    • one of: audio/*, video/*, image/*
  • Use ?fileInput in console to learn more

9.1.2 Server

In the server, we work with a data frame with a special structure. There are 4 columns:

  • name - name of the file on user’s computer
  • size - file size in bytes. Default 5 MB; adjust with shiny.maxRequestSize option.
  • type - MIME type of the file
  • datapath - file path on the server. Temporary.