fix: handle unicode filename and website uploads (#491)

* fix: print meaningful error message for invalid filenames

* fix: handle unicode dirnames and filenames

* chore: revert custom error message
This commit is contained in:
Cafe137
2022-07-26 13:13:25 +02:00
committed by GitHub
parent fd11f0166d
commit f82444f212
9 changed files with 167 additions and 7 deletions
+1 -1
View File
@@ -77,7 +77,7 @@ export function Upload(): ReactElement {
let fls: FilePath[] = files.map(f => packageFile(f)) // Apart from packaging, this is needed to not modify the original files array as it can trigger effects
let indexDocument: string | undefined = undefined // This means we assume it's folder
if (files.length === 1) indexDocument = files[0].name
if (files.length === 1) indexDocument = unescape(encodeURIComponent(files[0].name))
else if (files.length > 1) {
const idx = detectIndexHtml(files)