Skip to content

Commit

Permalink
fix(static): file access path
Browse files Browse the repository at this point in the history
  • Loading branch information
polonel committed Nov 7, 2018
1 parent dd440e0 commit 568c343
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/controllers/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ mainController.uploadFavicon = function(req, res) {
return file.resume();
}

var savePath = nconf.get('base_dir') + '/public/uploads/assets';
var savePath = path.join(__dirname, '../../public/uploads/assets');
if (!fs.existsSync(savePath)) fs.mkdirSync(savePath);

object.filePath = path.join(savePath, 'favicon' + path.extname(filename));
Expand Down Expand Up @@ -565,7 +565,7 @@ mainController.uploadLogo = function(req, res) {
return file.resume();
}

var savePath = nconf.get('base_dir') + '/public/uploads/assets';
var savePath = path.join(__dirname, '../../public/uploads/assets');
if (!fs.existsSync(savePath)) fs.mkdirSync(savePath);

object.filePath = path.join(savePath, 'topLogo' + path.extname(filename));
Expand Down Expand Up @@ -634,7 +634,7 @@ mainController.uploadPageLogo = function(req, res) {
return file.resume();
}

var savePath = nconf.get('base_dir') + '/public/uploads/assets';
var savePath = path.join(__dirname, '../../public/uploads/assets');
if (!fs.existsSync(savePath)) fs.mkdirSync(savePath);

object.filePath = path.join(savePath, 'pageLogo' + path.extname(filename));
Expand Down

0 comments on commit 568c343

Please sign in to comment.