1
0
Эх сурвалжийг харах

fix: upload file validation

Ahmad Kholid 2 жил өмнө
parent
commit
ed94be5055

+ 2 - 0
.gitignore

@@ -26,4 +26,6 @@ secrets.development.js
 get-pass-key.js
 getPassKey.js
 
+/business/prod
+
 .idea

+ 5 - 2
src/content/blocksHandler/handlerUploadFile.js

@@ -17,8 +17,11 @@ export default async function (block) {
 
   const getFile = async (path) => {
     let fileObject;
-
-    if (!path.startsWith('file') && !path.startsWith('http')) {
+    if (
+      path.includes('|') &&
+      !path.startsWith('file') &&
+      !path.startsWith('http')
+    ) {
       const [filename, mime, base64] = path.split('|');
       const response = await fetch(base64);
       const arrayBuffer = await response.arrayBuffer();