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

New feature: Multiple file picker #27

Closed
ChiefWiggum opened this issue Jan 18, 2019 · 5 comments
Closed

New feature: Multiple file picker #27

ChiefWiggum opened this issue Jan 18, 2019 · 5 comments
Labels
suggestion New feature or request
Milestone

Comments

@ChiefWiggum
Copy link

It would be great to have a method getFilePaths which allows the selection of multiple files, if the native picker allow this behaviour (not sure).
This method would then not return a single path, but a list/array of paths.

Does anyone know if the native file explorers support this behaviour?

@ChiefWiggum
Copy link
Author

Looking at the UIDocumentPickerViewController it seems to support selecting multiple files when setting allowsMultipleSelection to true on iOS.

On Android it might be possible by using EXTRA_ALLOW_MULTIPLE.

But we would have to use another ImagePicker, since the current one, afaik, does not support the selection of multiple files. Maybe multi_image_picker would work?

@miguelpruivo
Copy link
Owner

Yes, there is a way on both platform that supports multiple file picking, however that wasn't the first purpose of this plugin. However is a nice to have that may be added in a future update.

@miguelpruivo miguelpruivo added the suggestion New feature or request label Jan 18, 2019
@miguelpruivo miguelpruivo added this to the Goals milestone Feb 7, 2019
@miguelpruivo miguelpruivo added wip and removed wip labels Mar 7, 2019
@miguelpruivo
Copy link
Owner

miguelpruivo commented Mar 12, 2019

Version 1.3.0 was deployed on dart pub and adds this, alongside with other requested features and bug fixes. See full changelog.

Make sure you clean and change your pubspec to the latest version: file_picker: ^1.3.0

Thank you for your feedback.

@miguelpruivo
Copy link
Owner

@ChiefWiggum as of now, with version 1.6.0 released just now you can start filtering multiple extensions at once. There are breaking changes, so have in mind that from now on you'll need to provide an List of file types instead of a single one with FileType.custom.

Example:

 List<File> files = await FilePicker.getMultiFile(
          type: FileType.custom,
          allowedExtensions: ['jpg', 'pdf', 'doc'],
        );

Thank you.

@ChiefWiggum
Copy link
Author

Awesome, thank you. We'll give it a try in a few days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
suggestion New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants