Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
46d0eff2
Unverified
Commit
46d0eff2
authored
Feb 06, 2024
by
Timothy Jaeryang Baek
Committed by
GitHub
Feb 06, 2024
Browse files
Merge pull request #660 from ollama-webui/bulk-upload
feat: bulk document upload
parents
7f3ba3d2
0682a4a3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
25 deletions
+27
-25
src/routes/(app)/documents/+page.svelte
src/routes/(app)/documents/+page.svelte
+27
-25
No files found.
src/routes/(app)/documents/+page.svelte
View file @
46d0eff2
...
...
@@ -89,11 +89,9 @@
const inputFiles = e.dataTransfer?.files;
if (inputFiles && inputFiles.length > 0) {
const file
=
inputFiles
[0];
for (
const file
of
inputFiles
) {
console.log(file, file.name.split('.').at(-1));
if (['image/gif', 'image/jpeg', 'image/png'].includes(file['type'])) {
reader.readAsDataURL(file);
} else if (
if (
SUPPORTED_FILE_TYPE.includes(file['type']) ||
SUPPORTED_FILE_EXTENSIONS.includes(file.name.split('.').at(-1))
) {
...
...
@@ -104,6 +102,7 @@
);
uploadDoc(file);
}
}
} else {
toast.error(`File not found.`);
}
...
...
@@ -153,10 +152,12 @@
id="upload-doc-input"
bind:files={inputFiles}
type="file"
multiple
hidden
on:change={async (e) => {
if (inputFiles && inputFiles.length > 0) {
const file = inputFiles[0];
for (const file of inputFiles) {
console.log(file, file.name.split('.').at(-1));
if (
SUPPORTED_FILE_TYPE.includes(file['type']) ||
SUPPORTED_FILE_EXTENSIONS.includes(file.name.split('.').at(-1))
...
...
@@ -168,6 +169,7 @@
);
uploadDoc(file);
}
}
inputFiles = null;
e.target.value = '';
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment