summaryrefslogtreecommitdiffstats
path: root/client/lib
diff options
context:
space:
mode:
authorRomulus Urakagi Tsai <urakagi@gmail.com>2019-11-18 01:47:26 +0000
committerRomulus Urakagi Tsai <urakagi@gmail.com>2019-11-18 01:47:26 +0000
commit05c53ca01d71a01a608c9ae345475abd67c9939b (patch)
treea4ec2b021d87ece452709ff0b8dd3eaa794c44fd /client/lib
parent9fd14f7ecb593d3debf5adff8f6c61adb0c3feca (diff)
downloadwekan-05c53ca01d71a01a608c9ae345475abd67c9939b.tar.gz
wekan-05c53ca01d71a01a608c9ae345475abd67c9939b.tar.bz2
wekan-05c53ca01d71a01a608c9ae345475abd67c9939b.zip
Trying to upload an attachment with Meteor-Files
Diffstat (limited to 'client/lib')
-rw-r--r--client/lib/utils.js28
1 files changed, 17 insertions, 11 deletions
diff --git a/client/lib/utils.js b/client/lib/utils.js
index cc3526c0..2694396f 100644
--- a/client/lib/utils.js
+++ b/client/lib/utils.js
@@ -34,21 +34,27 @@ Utils = {
if (!card) {
return next();
}
- const file = new FS.File(fileObj);
+ let settings = {
+ file: fileObj,
+ streams: 'dynamic',
+ chunkSize: 'dynamic'
+ };
+ settings.meta = {};
if (card.isLinkedCard()) {
- file.boardId = Cards.findOne(card.linkedId).boardId;
- file.cardId = card.linkedId;
+ settings.meta.boardId = Cards.findOne(card.linkedId).boardId;
+ settings.meta.cardId = card.linkedId;
} else {
- file.boardId = card.boardId;
- file.swimlaneId = card.swimlaneId;
- file.listId = card.listId;
- file.cardId = card._id;
+ settings.meta.boardId = card.boardId;
+ settings.meta.swimlaneId = card.swimlaneId;
+ settings.meta.listId = card.listId;
+ settings.meta.cardId = card._id;
}
- file.userId = Meteor.userId();
- if (file.original) {
+ settings.meta.userId = Meteor.userId();
+ // FIXME: What is this?
+/* if (file.original) {
file.original.name = fileObj.name;
- }
- return next(Attachments.insert(file));
+ }*/
+ return next(Attachments.insert(settings, false));
},
shrinkImage(options) {
// shrink image to certain size