I would like our web-application to read images from our user's selected folder. The current UX is that the user must upload the folder of images, which takes an unacceptable amount of time, so we'd like to not require uploads. We're currently using the FileSystem API.

My hunch is that this is not doable with a web-app. If that's true, my next question is... can it be doable if it was a progressive web-app? What about an electron/desktop app?

EDIT: Sorry I should have specified.... Given a folder of images, I would like to 1) prompt the user to accept permission for the app to read those images once and then 2) allow the app to read images from that folder forever, regardless of whether they log out or reopen the app. Will edit original post.

Thanks in advance

1

There are 1 best solutions below

0
Charlie Lee On

It is possible to only require permission once to access a file or directory when using the File System Access API. You can do this by storing the file or directory handle in IndexedDB.

https://developer.chrome.com/articles/file-system-access/#storing-file-handles-or-directory-handles-in-indexeddb