Black Lives Matter. Please consider donating to Black Girls Code today.
Dash HoloViews is now available! Check out the docs.

Upload component: max_size and accept csv


I am using the dcc.upload component but I have some questions in some of their props usage:

  1. max_size which unit is using? an integer number of bytes? a string with the corresponding unit, like 150MB? The docs doesn’t show any example on how to use it.
  2. accept: csv. Here, the documentation says that csv files are considered text/plain in mac and application/ in Windows.
    So what is the proper way to filter to only allow csv files? I have seen only examples where they don’t use the accept prop and they just filter by filename and drop any other file that doesn’t end in .csv, however it would be clearer in code and better for the user if the file-chooser dialog would show files only ending in .csv.

Re 1. Had the same question. The Upload component seems to use Dropzone, and the Dropzone documentation says to provide an integer number of bytes.