Hey!
I started to build a small UI based on gio. I would like to use the
explorer component, and I like that it uses the native file browser.
However, the current explorer.ChooseFiles returns a slice of
io.ReadCloser, but for me the path to the selected files would be
better.
Do you think it's possible to have an API which returns the file list instead?
Thanks
--
Lajos Koszti
On Mon, Apr 29, 2024 at 5:44 AM Lajos Koszti <ajnasz@ajnasz.hu> wrote:
>
> Hey!
>
> I started to build a small UI based on gio. I would like to use the
> explorer component, and I like that it uses the native file browser.
> However, the current explorer.ChooseFiles returns a slice of
> io.ReadCloser, but for me the path to the selected files would be
> better.
> Do you think it's possible to have an API which returns the file list instead?
It is not possible to do this on all supported platforms. Most
notably, WASM, Android, and iOS do not surface the filesystem path
within the sandbox that the app runs within.
On *some* platforms, you can type-assert the returns files to
`*os.File` and then call `Name()` to get their paths, but this doesn't
work universally.
I don't know of any way around this.
Cheers,
Chris