I'd like to make an application where a user can select a directory on their own computer, and I can refer to the images in that directory across page refreshes/etc. For example, the user selects a directory, or just multiple image files, and then every time the page is refreshed, display a random image from the selected directory. I don't want the images to get uploaded to my server, rather allow users to customize the experience by selecting which images get displayed on a session-by-session basis. I know it sounds like a very obscure scenario, but there is at least one circle of people I know of who will really appreciate this functionality.
Is there some way to achieve this with the HTML5 file api?
I'm currently using:
$imagesDir = 'random/';
$images = glob($imagesDir . '*.{jpg,jpeg,png,gif}', GLOB_BRACE);
$randomImage = $images[array_rand($images)];
to serve a random image from a directory on my server at each page refresh. I'd like the user to be able to replace this directory with a directory they select on their own computer.