浏览代码

Treat unknown attachment types as binary on board import/clone

Fixes missing attachments and even missing
Daniel Eder 4 年之前
父节点
当前提交
6bd7f40511
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      models/wekanCreator.js

+ 6 - 0
models/wekanCreator.js

@@ -474,6 +474,12 @@ export class WekanCreator {
                 }
                 }
               });
               });
             } else if (att.file) {
             } else if (att.file) {
+              //If attribute type is null or empty string is set, assume binary stream
+              att.type =
+                !att.type || att.type.trim().length === 0
+                  ? 'application/octet-stream'
+                  : att.type;
+
               file.attachData(
               file.attachData(
                 Buffer.from(att.file, 'base64'),
                 Buffer.from(att.file, 'base64'),
                 {
                 {