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

Unsupported filter when passing "realm" as allowedExtensions #1375

Closed
1 of 4 tasks
milindgoel15 opened this issue Oct 1, 2023 · 11 comments
Closed
1 of 4 tasks

Unsupported filter when passing "realm" as allowedExtensions #1375

milindgoel15 opened this issue Oct 1, 2023 · 11 comments
Labels
new issue An issue that hasn't yet been seen from the maintainer stale

Comments

@milindgoel15
Copy link

Describe the bug
Using the file_picker latest package as of today from pub.dev, when trying to provide a custom allowedExtensions throws a

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))

Although I am not too sure if this is a bug. But I am using realm db by MongoDB in my app and wanted to pick a local saved realm db file to restore in my app. Having the file type set to custom throws the exception above. Using any filetypes works perfectly. So will these extension be supported by the plugin or is it something the platform cannot support ever?

Platform

  • Android
  • iOS
  • Web
  • Desktop

Platform OS version
Android 13

How are you picking?

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

Details to reproduce the issue
Just replace the code above in your solution or fresh flutter project

Error Log

W/FilePickerUtils(  633): Custom file type realm is unsupported and will be ignored.
D/FilePickerUtils(  633): Allowed file extensions mimes: []
I/flutter (  633): [MethodChannelFilePicker] Platform exception: 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)
E/flutter (  633): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: 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)
E/flutter (  633): #0      StandardMethodCodec.decodeEnvelope
message_codecs.dart:652
E/flutter (  633): #1      MethodChannel._invokeMethod
platform_channel.dart:310
E/flutter (  633): <asynchronous suspension>
E/flutter (  633): #2      MethodChannel.invokeListMethod
platform_channel.dart:496
E/flutter (  633): <asynchronous suspension>
E/flutter (  633): #3      FilePickerIO._getPath
file_picker_io.dart:92
E/flutter (  633): <asynchronous suspension>
E/flutter (  633): #4      _SettingsState.build.<anonymous closure>
settings.dart:563
E/flutter (  633): <asynchronous suspension>
E/flutter (  633):

Screenshots and/or video
na

Flutter Version details

[✓] Flutter (Channel stable, 3.13.4, on Microsoft Windows [Version 10.0.22621.2361], locale en-IN)
    • Flutter version 3.13.4 on channel stable at C:\sdks\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 367f9ea16b (3 weeks ago), 2023-09-12 23:27:53 -0500
    • Engine revision 9064459a8b
    • Dart version 3.1.2
    • DevTools version 2.25.0

[✓] Windows Version (Installed version of Windows is version 10 or higher)

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at C:\Users\Lenovo\AppData\Local\Android\Sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_SDK_ROOT = C:\Users\Lenovo\AppData\Local\Android\Sdk
    • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-10027231)
    • All Android licenses accepted.

[✓] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.6.0)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.6.33712.159
    • Windows 10 SDK version 10.0.22621.0

[✓] Android Studio (version 2022.3)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-10027231)

[✓] VS Code, 64-bit edition (version 1.82.2)
    • VS Code at C:\Program Files\Microsoft VS Code
    • Flutter extension version 3.66.0

[✓] Connected device (2 available)
    • 2109119DI (mobile) • 417812e0 • android-arm64 • Android 13 (API 33)
    • Windows (desktop)  • windows  • windows-x64   • Microsoft Windows [Version 10.0.22621.2361]

[✓] Network resources
    • All expected network resources are available.

• No issues found!

Additional context
Add any other context about the problem here.

@milindgoel15 milindgoel15 added the new issue An issue that hasn't yet been seen from the maintainer label Oct 1, 2023
@github-actions
Copy link

github-actions bot commented Oct 9, 2023

This issue is stale because it has been open for 14 days with no activity.

@github-actions github-actions bot added the stale label Oct 9, 2023
@milindgoel15
Copy link
Author

It's only been 8 days bot.

@github-actions github-actions bot removed the stale label Oct 10, 2023
@github-actions
Copy link

This issue is stale because it has been open for 14 days with no activity.

@github-actions github-actions bot added the stale label Oct 17, 2023
@milindgoel15
Copy link
Author

No stale

@github-actions github-actions bot removed the stale label Oct 18, 2023
@github-actions
Copy link

This issue is stale because it has been open for 14 days with no activity.

@github-actions github-actions bot added the stale label Oct 26, 2023
@milindgoel15
Copy link
Author

No stale

@github-actions github-actions bot removed the stale label Oct 27, 2023
Copy link

github-actions bot commented Nov 3, 2023

This issue is stale because it has been open for 14 days with no activity.

@github-actions github-actions bot added the stale label Nov 3, 2023
Copy link

This issue was closed because it has been inactive for 14 days since being marked as stale.

@milindgoel15
Copy link
Author

Please reopen the issue. There's no point in adding stale to an issue when no one replied.

@thobiassilva
Copy link

I have the same problem with other custom extensions

@stephane-archer
Copy link
Contributor

#1628

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 stale
Projects
None yet
Development

No branches or pull requests

3 participants