change path

master
Lucas 2 years ago
parent 8c0b294d21
commit 02f5d1d5f9
  1. 3
      src/api/controllers/v1/path.controller.js
  2. 2
      src/common/services/adapters/upload-adapter.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 {

@ -74,7 +74,7 @@ const storage = multer.diskStorage({
// : file.originalname;
cb(
null,
`/${path}/${file.originalname}`
`/${path}/${file.originalname.replace(/\s/g, '')}`
);
}
});

Loading…
Cancel
Save