mirror of
https://github.com/open-webui/open-webui
synced 2024-11-16 05:24:02 +00:00
Merge pull request #2388 from Yanyutin753/uploadImage
⭐ Expend upload image file types
This commit is contained in:
commit
0ede1d1483
@ -357,7 +357,7 @@
|
||||
if (inputFiles && inputFiles.length > 0) {
|
||||
inputFiles.forEach((file) => {
|
||||
console.log(file, file.name.split('.').at(-1));
|
||||
if (['image/gif', 'image/jpeg', 'image/png'].includes(file['type'])) {
|
||||
if (['image/gif', 'image/webp', 'image/jpeg', 'image/png'].includes(file['type'])) {
|
||||
let reader = new FileReader();
|
||||
reader.onload = (event) => {
|
||||
files = [
|
||||
@ -547,7 +547,7 @@
|
||||
if (inputFiles && inputFiles.length > 0) {
|
||||
const _inputFiles = Array.from(inputFiles);
|
||||
_inputFiles.forEach((file) => {
|
||||
if (['image/gif', 'image/jpeg', 'image/png'].includes(file['type'])) {
|
||||
if (['image/gif', 'image/webp', 'image/jpeg', 'image/png'].includes(file['type'])) {
|
||||
let reader = new FileReader();
|
||||
reader.onload = (event) => {
|
||||
files = [
|
||||
|
@ -127,7 +127,7 @@
|
||||
|
||||
if (
|
||||
files.length > 0 &&
|
||||
['image/gif', 'image/jpeg', 'image/png'].includes(files[0]['type'])
|
||||
['image/gif', 'image/webp', 'image/jpeg', 'image/png'].includes(files[0]['type'])
|
||||
) {
|
||||
reader.readAsDataURL(files[0]);
|
||||
}
|
||||
|
@ -339,7 +339,7 @@ SYSTEM """${system}"""`.replace(/^\s*\n/gm, '');
|
||||
if (
|
||||
inputFiles &&
|
||||
inputFiles.length > 0 &&
|
||||
['image/gif', 'image/jpeg', 'image/png'].includes(inputFiles[0]['type'])
|
||||
['image/gif', 'image/webp', 'image/jpeg', 'image/png'].includes(inputFiles[0]['type'])
|
||||
) {
|
||||
reader.readAsDataURL(inputFiles[0]);
|
||||
} else {
|
||||
|
@ -238,7 +238,7 @@
|
||||
if (
|
||||
inputFiles &&
|
||||
inputFiles.length > 0 &&
|
||||
['image/gif', 'image/jpeg', 'image/png'].includes(inputFiles[0]['type'])
|
||||
['image/gif', 'image/webp', 'image/jpeg', 'image/png'].includes(inputFiles[0]['type'])
|
||||
) {
|
||||
reader.readAsDataURL(inputFiles[0]);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user