summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorRomulus Urakagi Tsai <urakagi@gmail.com>2020-05-06 11:15:01 +0800
committerRomulus Urakagi Tsai <urakagi@gmail.com>2020-05-06 11:15:01 +0800
commit7dc0bbd7b26ef50ebd6c0a4d719658c2d288c2d3 (patch)
treea287a536b7fb4538df418481185db8c46c91cc48 /server
parent269698ba780a0af5fe0b24fc3c2c43d1f3f1b49d (diff)
downloadwekan-7dc0bbd7b26ef50ebd6c0a4d719658c2d288c2d3.tar.gz
wekan-7dc0bbd7b26ef50ebd6c0a4d719658c2d288c2d3.tar.bz2
wekan-7dc0bbd7b26ef50ebd6c0a4d719658c2d288c2d3.zip
Set correct storage location
Diffstat (limited to 'server')
-rw-r--r--server/migrations.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/server/migrations.js b/server/migrations.js
index 33f061f5..b02ca246 100644
--- a/server/migrations.js
+++ b/server/migrations.js
@@ -1048,7 +1048,11 @@ Migrations.add('change-attachment-library', () => {
const bucket = new MongoInternals.NpmModule.GridFSBucket(MongoInternals.defaultRemoteCollectionDriver().mongo.db, {bucketName: 'cfs_gridfs.attachments'});
const gfsId = new MongoInternals.NpmModule.ObjectID(file.copies.attachments.key);
const reader = bucket.openDownloadStream(gfsId);
- const path = `/var/attachments/${file.name()}`;
+ let store = Attachments.storagePath();
+ if (store.charAt(store.length - 1) === '/') {
+ store = store.substring(0, store.length - 1);
+ }
+ const path = `${store}/${file.name()}`;
const fd = fs.createWriteStream(path);
reader.pipe(fd);
let opts = {