Nolan Blew
Nolan Blew

Reputation: 383

UWP File Picker FileTypeFilter Exception

I have a very simple question, but is there a way while using a FilePicker in a UWP app to specify a file filter such as "All files except .exe and .pdf"?

I know to specify only a filter for these files you would use:

openPicker.FileTypeFilter.Add(".exe");  
openPicker.FileTypeFilter.Add(".pdf");

Or to include all files you would use:

openPicker.FileTypeFilter.Add("*");  

So is there a way to specify * except .exe and .pdf?

Upvotes: 2

Views: 464

Answers (1)

Matt Lacey
Matt Lacey

Reputation: 65564

No. It's much more common to only accept a few types or, genuinely, anything.
If you really can accept anything apart from .exe and .pdf then accept anything and then validate after the file is selected.

Upvotes: 3

Related Questions