Добавлено восстановление файлов из webdav

This commit is contained in:
Book Pauk
2022-07-16 20:35:34 +07:00
parent 522826311d
commit edc3b669be

View File

@@ -107,17 +107,11 @@ function initStatic(app, config) {
//восстановим //восстановим
if (!await fs.pathExists(filePath)) { if (!await fs.pathExists(filePath)) {
/*const zlib = require('zlib'); if (req.path.indexOf('/tmp/') === 0) {
const gzipBuffer = async(buf) => { await readerWorker.restoreRemoteFile(req.path, '/tmp');
return new Promise((resolve, reject) => { } else if (req.path.indexOf('/upload/') === 0) {
zlib.gzip(buf, {level: 1}, (err, result) => { await readerWorker.restoreRemoteFile(req.path, '/upload');
if (err) reject(err); }
resolve(result);
});
});
};
await fs.writeFile(filePath, await gzipBuffer(`<filepath>${filePath}</filepath>`));*/
} }
return next(); return next();