allow overriding location of chunks

Closes #302
This commit is contained in:
Bobby Wibowo 2020-11-10 01:07:10 +07:00
parent d796b31bd1
commit 896f74e0ca
No known key found for this signature in database
GPG Key ID: 51C3A1E1E22D26CF
2 changed files with 9 additions and 1 deletions

View File

@ -255,6 +255,12 @@ module.exports = {
timeout: 30 * 60 * 1000 // 30 minutes
},
/*
Folder where in-progress chunks should be kept temporarily.
NOTE: When set to falsy value, defaults to "chunks" subfolder within uploads folder.
*/
chunksFolder: null,
/*
Max file size allowed for upload by URLs. Needs to be in MB.
NOTE: Set to falsy value to disable upload by URLs.

View File

@ -25,7 +25,9 @@ for (const fsFunc of fsFuncs) {
}
self.uploads = path.resolve(config.uploads.folder)
self.chunks = path.join(self.uploads, 'chunks')
self.chunks = config.uploads.chunksFolder
? path.resolve(config.uploads.chunksFolder)
: path.join(self.uploads, 'chunks')
self.thumbs = path.join(self.uploads, 'thumbs')
self.zips = path.join(self.uploads, 'zips')