Allow a certain filetype with dcc.Upload


is there a way to specify the filetype a user can upload using dcc.Upload?

yes there is an attribute of dcc.Upload called accept link:

accept (string; optional): Allow specific types of files. See GitHub - react-dropzone/attr-accept: JavaScript implementation of the "accept" attribute for HTML5 input element for more information. Keep in mind that mime type determination is not reliable across platforms. CSV files, for example, are reported as text/plain under macOS but as application/ under Windows. In some cases there might not be a mime type set at all.

So for example accept = ‘.zip’

1 Like