Performing file I/O for file upload/download
I am using Chonky as a front end to Google Cloud Storage. I can see my files and folders in my browser that exist in GCS. All is good. However, I'd like to add the ability to upload and download files from my local file system. I see that I can perform actions for upload and download and the corresponding callbacks are triggered. Where I'm getting stuck is figuring out what to do in the callbacks.
For file download ... I think I want to open a dialog box that provides a local file selection mechanism to select the local (to browser) folder/directory/file into which the GCS file should be saved.
For file upload ... I think I want to open a dialog box that provides a local file selection mechanism to select the local (to browser) file that should be uploaded into the current GCS shown folder.
I haven't seen any samples of using Chonky in this regard. If no samples, does anyone have high level notions of how to approach the task from a coarse grained building blocks perspective?
I am also interested on how to do this. I hope someone gives some attention to this issue 🤞
I found that this blog post shows how to handle the Download files action:
https://lewisadeveloper.hashnode.dev/create-a-filesystem-browser-with-reactjs-and-chonky
See where downloadFiles() is called, and its implementation.
Interestingly, the DownloadFiles action has no .payload; instead you are apprently supposed to use data.state.selectedFiles as shown there, to determine what files the user had selected.
The blog post uses downloadjs to offer the downloaded blob as a file for local download.
Is there any example for uploading file/folder as well ?