Forum Xamarin.Forms

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

lpinholpinho USMember ✭✭


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


Sign In or Register to comment.