flutter_file_picker icon indicating copy to clipboard operation
flutter_file_picker copied to clipboard

How to pick files or directory?

Open BirjuVachhani opened this issue 2 years ago • 4 comments

I know we can use pickFiles() to open file picker and getDirectoryPath() to choose a directory but my use case allows user to select files or directory or both at the same time. How can I achieve this with this plugin?

For example, I also implemented drag and drop files support using desktop_drop package which supports both files and directory dropping. So when I drop things, it gives me List<XFile> where can contain directories if I have selected any. I can't do this with this plugin. A lot of native apps does this.

I have tested this on MacOS. pickFiles() doesn't allow selecting directories too. Only files.

I'd like to allow both at the same time. Can you please help?

BirjuVachhani avatar Aug 31 '22 20:08 BirjuVachhani

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

github-actions[bot] avatar Sep 08 '22 02:09 github-actions[bot]

Any updates?

BirjuVachhani avatar Sep 08 '22 05:09 BirjuVachhani

Which platform are you trying this on?

miguelpruivo avatar Sep 15 '22 09:09 miguelpruivo

@miguelpruivo I have the same use-case as OP and can confirm that exactly what they described happens when using macOS (Monterey 12.6).

With pickFiles, when highlighting a directory and clicking Choose, the directory is simply opened as if I had double-clicked it, rather than being returned. With getDirectoryPath, all files are grayed out and thus cannot be selected. Also, it is not possible to select multiple folders at once.

au2001 avatar Sep 19 '22 17:09 au2001

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

github-actions[bot] avatar Sep 27 '22 02:09 github-actions[bot]

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

github-actions[bot] avatar Oct 06 '22 02:10 github-actions[bot]

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

github-actions[bot] avatar Oct 20 '22 02:10 github-actions[bot]

up

au2001 avatar Oct 20 '22 03:10 au2001

@miguelpruivo can you reopen this issue?

Aunali321 avatar Nov 13 '22 08:11 Aunali321

This was immediately the first thing i realized was missing. Need a way to select a mixture of multiple files and folders in the same picker window. The native picker on macOS has support for this at least.

Without this feature, opening av picker becomes a much worse experience, compared to drag and drop. But some people are not tech savvy enough to perform a drop and drop, especially not on a small laptop where cmd+tab needs to be involved at the same time when dragging.

🤞🏻

bobmoff avatar Nov 22 '22 09:11 bobmoff