Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to pick sf2 file (sound font) on Android #1462

Closed
KapitanPL opened this issue Mar 13, 2024 · 3 comments
Closed

Unable to pick sf2 file (sound font) on Android #1462

KapitanPL opened this issue Mar 13, 2024 · 3 comments
Labels
new issue An issue that hasn't yet been seen from the maintainer

Comments

@KapitanPL
Copy link

I tried to use file_picker to select sound font file with extension sf2

FilePickerResult? result = await FilePicker.platform.pickFiles(allowedExtensions: ['sf2']);

results in:
Exception: You are setting a type [FileType.any]. Custom extension filters are only allowed with FileType.custom, please change it or remove filters.

Following the advice:

FilePickerResult? result = await FilePicker.platform.pickFiles(type: FileType.custom, allowedExtensions: ['sf2']);

results in
PlatformException (PlatformException(FilePicker, Unsupported filter. Make sure that you are only using the extension without the dot, (ie., jpg instead of .jpg). This could also have happened because you are using an unsupported file extension. If the problem persists, you may want to consider using FileType.all instead., null, null))

There is no FileType.all, only FileType.any

Could you help me use the picker for this file? What is the reason for unsupported filter?

@KapitanPL KapitanPL added the new issue An issue that hasn't yet been seen from the maintainer label Mar 13, 2024
@miguelpruivo
Copy link
Owner

It's a typo, you should use FileType.any.

Thanks.

@KapitanPL
Copy link
Author

KapitanPL commented Mar 20, 2024

@miguelpruivo Tried. Does not work.
It then tries to get MIME type of such file. It does not as it is not a "usual" kind of file.
And simply fails.

I had to let user choose any file and then if the extension is not correct, display a warning message and let him choose again.

1e3205b

I tried to solve i here... but it had flaws ...

But it can ilustrate the problem

@melWiss
Copy link

melWiss commented Jun 13, 2024

do we have news about this one? i'm trying to import msg files only but i had to go with the same idea, i mean letting the user selecting anything and then i filter which isn't the best user experience i think

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new issue An issue that hasn't yet been seen from the maintainer
Projects
None yet
Development

No branches or pull requests

3 participants