Server side - Implement uploading

This commit is contained in:
2019-05-27 14:21:51 +05:30
parent 81ad30ab51
commit 0c428a2b33
2 changed files with 54 additions and 12 deletions

View File

@@ -1,4 +1,5 @@
const path = require('path')
const os = require('os')
module.exports.mergedir = (dirname,settings)=>{
return path.normalize(path.join(settings.dirname,dirname));
}
@@ -20,3 +21,8 @@ module.exports.dirprocess = (dirstream,location,settings)=>{
return contents
}
// settings.dirname, whatever
module.exports.inDir = (dircheck,dirmain) => !path.relative(path.normalize(dircheck), dirmain).startsWith('..')
module.exports.getTmpDir = (location) => path.join(os.tmpdir(), path.basename(location))