Forum Xamarin.Forms
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

Why does MimeTypeMap.Singleton.GetMimeTypeFromExtension for db returns null?

lpinholpinho USMember ✭✭

Hi,

I'm trying to change the filepicker (FilePicker-Plugin-for-Xamarin-and-Windows) intent to only show me db files, I thought that if I passed the correct mime-type it would only show me the db files.

I tried several mime-types associated with .db files (sqlite) and none worked, so I tried to get the mime type like this:

            string extension = MimeTypeMap.GetFileExtensionFromUrl(filedata.FilePath);
            string mimeType = MimeTypeMap.Singleton.GetMimeTypeFromExtension(extension);

And mimeType is set to null.

This is the code I want to change (FilePickerActivity.cs):

Am I doing something stupid?

Thanks for the help,

Luís Pinho

Answers

Sign In or Register to comment.