mirror of
https://github.com/wekan/wekan.git
synced 2025-12-24 11:20:13 +01:00
Set correct storage location
This commit is contained in:
parent
269698ba78
commit
7dc0bbd7b2
1 changed files with 5 additions and 1 deletions
|
|
@ -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 = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue