diff --git a/src/api/controllers/v1/path.controller.js b/src/api/controllers/v1/path.controller.js index f7523b5..b16ef78 100644 --- a/src/api/controllers/v1/path.controller.js +++ b/src/api/controllers/v1/path.controller.js @@ -79,7 +79,6 @@ exports.create = (req, res, next) => { */ exports.update = (req, res, next) => { try { - console.log(cdnConfig.uri, storageConfig.uri); const oldPath = req.body.oldPath.replace(cdnConfig.uri, storageConfig.uri); const newPath = req.body.newPath.replace(cdnConfig.uri, storageConfig.uri); @@ -132,7 +131,7 @@ exports.download = (req, res, next) => { archive.pipe(output); if (req.body.data) { req.body.data.forEach((e) => { - const path = e.path.replace(cdnConfig.uri, storageConfig.uri); + const path = e.path.replace(cdnConfig.uri, storageConfig.uri).replace(/ /g, '%20'); if (e.isFolder) { archive.directory(path, e.name); } else { diff --git a/src/common/services/adapters/upload-adapter.js b/src/common/services/adapters/upload-adapter.js index e294dea..e860f8d 100644 --- a/src/common/services/adapters/upload-adapter.js +++ b/src/common/services/adapters/upload-adapter.js @@ -74,7 +74,7 @@ const storage = multer.diskStorage({ // : file.originalname; cb( null, - `/${path}/${file.originalname}` + `/${path}/${file.originalname.replace(/\s/g, '')}` ); } });