Open rogusdev opened 3 days ago
Problem
Using a directory / webkitdirectory file input to upload a directory, and then looping over the files() results, 2 things are broken:
Steps To Reproduce
input { type: "file", multiple: true, directory: true, onchange: move |evt| { if let Some(file_engine) = evt.files() { for filename in file_engine.files() { log::warn!("filename {filename}"); } } }, }
Expected behavior
If you upload a folder "a", with structure like:
a/1.txt a/o.txt a/b/1.txt a/b/2.txt
You will only see:
1.txt o.txt 2.txt
Which has lost the second 1.txt, because it also lost the subdir "b" from the file paths.
Instead I would like to see:
Note that the initial "a/" is required, because a folder was uploaded, not simply files inside that folder!
Environment:
Questionnaire
I'm interested in fixing this myself but don't know where to start
Related to https://github.com/DioxusLabs/dioxus/issues/3134
And I am looking into how I can implement this in Dioxus.
Problem
Using a directory / webkitdirectory file input to upload a directory, and then looping over the files() results, 2 things are broken:
Steps To Reproduce
Expected behavior
If you upload a folder "a", with structure like:
You will only see:
Which has lost the second 1.txt, because it also lost the subdir "b" from the file paths.
Instead I would like to see:
Note that the initial "a/" is required, because a folder was uploaded, not simply files inside that folder!
Environment:
Questionnaire
I'm interested in fixing this myself but don't know where to start