Skip to content

Commit 6d20780

Browse files
authored
perf: change upload folder to upload fold's files (#1087)
1 parent 05e6506 commit 6d20780

File tree

1 file changed

+3
-1
lines changed
  • web/src/pages/app/storages/mods/UploadButton

1 file changed

+3
-1
lines changed

web/src/pages/app/storages/mods/UploadButton/index.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ function UploadButton(props: { onUploadSuccess: Function; children: React.ReactE
5555
setFileList(newFileList);
5656
for (let i = 0; i < files.length; i++) {
5757
const file = files[i];
58-
const fileName = file.webkitRelativePath ? file.webkitRelativePath : file.name;
58+
const fileName = file.webkitRelativePath
59+
? file.webkitRelativePath.replace(/^[^/]*\//, "")
60+
: file.name;
5961
await uploadFile(currentStorage?.name!, prefix + fileName, file, {
6062
contentType: file.type,
6163
});

0 commit comments

Comments
 (0)