Agent Zero AI framework
extension filters unlock
frdel665b6c5f2710
diff --git a/python/api/upload.py b/python/api/upload.pyindex ea6851577..02aaa7186 100644--- a/python/api/upload.py+++ b/python/api/upload.py@@ -23,5 +23,6 @@ class UploadFile(ApiHandler):def allowed_file(self,filename):- ALLOWED_EXTENSIONS = {"png", "jpg", "jpeg", "txt", "pdf", "csv", "html", "json", "md"}- return "." in filename and filename.rsplit(".", 1)[1].lower() in ALLOWED_EXTENSIONS\ No newline at end of file+ return True+ # ALLOWED_EXTENSIONS = {"png", "jpg", "jpeg", "txt", "pdf", "csv", "html", "json", "md"}+ # return "." in filename and filename.rsplit(".", 1)[1].lower() in ALLOWED_EXTENSIONS\ No newline at end of filediff --git a/webui/index.html b/webui/index.htmlindex cb800a7df..808ca2791 100644--- a/webui/index.html+++ b/webui/index.html@@ -223,17 +223,10 @@handleFileUpload(event) {const files = event.target.files;- //if (files.length + this.attachments.length > 4) {- // alert('Maximum 4 attachments allowed');- // return;- //}Array.from(files).forEach(file => {const ext = file.name.split('.').pop().toLowerCase();- const allowedExts = new Set(['jpg', 'jpeg', 'png', 'bmp', 'md', 'py', 'js', 'sh',- 'html', 'css', 'pdf', 'txt', 'csv', 'json']);-- //if (allowedExts.has(ext)) {+const isImage = ['jpg', 'jpeg', 'png', 'bmp'].includes(ext);if (isImage) {@@ -260,7 +253,6 @@});this.hasAttachments = true;}- //}});}}">@@ -296,9 +288,7 @@d="M16.5 6v11.5c0 2.21-1.79 4-4 4s-4-1.79-4-4V5c0-1.38 1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5v10.5c0 .55-.45 1-1 1s-1-.45-1-1V6H10v9.5c0 1.38 1.12 2.5 2.5 2.5s2.5-1.12 2.5-2.5V5c0-2.21-1.79-4-4-4S7 2.79 7 5v12.5c0 3.04 2.46 5.5 5.5 5.5s5.5-2.46 5.5-5.5V6h-1.5z" /></svg></label>- <input type="file" id="file-input"- accept=".png, .jpg, .jpeg, .txt, .pdf, .csv, .html, .json, .md, .py, .js, .sh, .css"- multiple style="display: none" @change="handleFileUpload($event)">+ <input type="file" id="file-input" accept="*" multiple style="display: none" @change="handleFileUpload($event)"><div x-show="showTooltip" class="tooltip">Add attachments to the messagediff --git a/webui/index.js b/webui/index.jsindex 524ffbb3f..eb50e8eb4 100644--- a/webui/index.js+++ b/webui/index.js@@ -916,10 +916,7 @@ document.addEventListener('DOMContentLoaded', () => {function handleFiles(files, inputAD) {Array.from(files).forEach(file => {const ext = file.name.split('.').pop().toLowerCase();- const allowedExts = new Set(['jpg', 'jpeg', 'png', 'bmp', 'md', 'py', 'js', 'sh',- 'html', 'css', 'pdf', 'txt', 'csv', 'json']);-- if (allowedExts.has(ext)) {+const isImage = ['jpg', 'jpeg', 'png', 'bmp'].includes(ext);if (isImage) {@@ -944,7 +941,7 @@ function handleFiles(files, inputAD) {});inputAD.hasAttachments = true;}- }+});}