Filtering file selections with DocumentPicker API using MIME types

HOW TO SPECIFY MULTIPLE TYPES

According to the docs, you can specify what files to be displayed when document picker is launched by setting the MIME type like this if you want all images:

DocumentPicker.getDocumentAsync({
type: “image/*”,
});

By default if type is not specified it will show all file with any types.
Now, I wanted to specify multiple types to narrow down the result and I’ve tried this but it only display what is indicated before the first comma(,) and that is all image files:

DocumentPicker.getDocumentAsync({
type: “image/,application/”,
});

If you have ideas on how to achieve multiple types I would really appreciate it.
Thanks alot!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.