mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-28 06:22:33 +00:00
fix: dropping several folders on a knowledge base uploads all of them (#32653)
This commit is contained in:
parent
d8bef1ef90
commit
d907b61816
1 changed files with 6 additions and 7 deletions
|
|
@ -727,10 +727,12 @@
|
|||
const directoryEntries: DirectoryFileEntry[] = [];
|
||||
const looseFiles: File[] = [];
|
||||
|
||||
for (const rawItem of Array.from(inputItems)) {
|
||||
const droppedItems = Array.from(inputItems).map((rawItem) => {
|
||||
const item = rawItem as DataTransferItem & { webkitGetAsEntry?: () => any };
|
||||
const entry = item.webkitGetAsEntry?.();
|
||||
return { entry: item.webkitGetAsEntry?.(), file: item.getAsFile() };
|
||||
});
|
||||
|
||||
for (const { entry, file } of droppedItems) {
|
||||
if (entry?.isDirectory) {
|
||||
try {
|
||||
directoryEntries.push(...(await collectDroppedEntryFiles(entry)));
|
||||
|
|
@ -738,11 +740,8 @@
|
|||
handleUploadError(error);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
const file = item.getAsFile();
|
||||
if (file) {
|
||||
looseFiles.push(file);
|
||||
}
|
||||
} else if (file) {
|
||||
looseFiles.push(file);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue