beakerbrowser / beaker

An experimental peer-to-peer Web browser
https://beakerbrowser.com/
MIT License
6.75k stars 545 forks source link

File upload controls in the page #1910

Closed zootella closed 3 years ago

zootella commented 3 years ago

Here I've got Beaker navigated to a page I'm writing in a hyperdrive I can edit. I clicked Drive, Explore Files to display the pane on the left:

image

To add files to my hyperdrive, I can drag them from Finder or Windows Explorer to the Files pane. I can also right-click the Files pane and choose Import folder(s) instead of dragging.

Is there a way to do this right in the page? I'd like to add it to my beaker app. The user may not have the pane open, and I'm hoping the page can show additional status as Beaker is importing the files, also.

zootella commented 3 years ago

Chatted on Discord, and posting the answer here:

https://developer.mozilla.org/en-US/docs/Web/API/FileReader

should be all we need. Regular front-end Web APIs go from the file system to the page, and then the page can use Beaker APIs to write the files to the hyperdrive.