File Picker in Windows Phone 8.1 SilverLight

249 views Asked by At

I want to choose all files from the My internal as well as External Sd Card in Windows Phone 8.1 Silverlight App. I have tried this bolow code

FileOpenPicker openPicker = new FileOpenPicker();
  openPicker.FileTypeFilter.Add(".Mp3");
            openPicker.FileTypeFilter.Add(".wav");
            openPicker.FileTypeFilter.Add(".mp4");
            openPicker.FileTypeFilter.Add(".wmv");
            openPicker.FileTypeFilter.Add(".xap");
            openPicker.FileTypeFilter.Add(".apk");

for this I have to specify file type. and yes I found a problem in these file type if I have added code for .mp4 ,.png , .jpg it will open Picture Lib. of Phone but I have added code for other than these than It will redirect me on Option of Phone and One Drive. So is there any solution which allow me to choose all file type from the sdcard

Thanks.

3

There are 3 answers

0
Maulik Shah On

I found answer @thisLink according to it I just need to declare

fileOpenPicker.FileTypeFilter.Add("*");
0
Nikita Kunevich On

Unfortunately, it is impossible to access ANY file type from Removable Storage, because, as you know, you should declare all the file types you are using.

As Maulik Shah said, one can set filePickerFilter to all file types at once using wildcard (*):

fileOpenPicker.FileTypeFilter.Add("*");

As you can see you can access SD card storage from phone option.

SD card is mapped to the phone option

P.S.You don't need to declare Removable Storage capability if you access files via file picker.

0
MeSaNei On

Do you have Removable Storage capability in the app manifest file? https://msdn.microsoft.com/en-us/library/windows/apps/br230259.aspx