UWP File Picker FileTypeFilter Exception

Asked at 2017-01-11 17:40:54Z
  • 5 Subscribers
  • 114 Views
2

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?


1 answers in total

2
Matt Lacey Posted at 2017-01-11 20:35:15Z

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.

Answer this questsion