mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-06 22:15:48 +01:00
path join on user routers
This commit is contained in:
@@ -113,8 +113,7 @@ var user = require('./../user.js'),
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var filename = path.basename(oldpicture);
|
var absolutePath = path.join(global.configuration['ROOT_DIRECTORY'], config.upload_path, path.basename(oldpicture));
|
||||||
var absolutePath = global.configuration['ROOT_DIRECTORY'] + config.upload_path + filename;
|
|
||||||
|
|
||||||
fs.unlink(absolutePath, function(err) {
|
fs.unlink(absolutePath, function(err) {
|
||||||
if(err) {
|
if(err) {
|
||||||
@@ -124,9 +123,7 @@ var user = require('./../user.js'),
|
|||||||
uploadUserPicture(req.user.uid, req.files.userPhoto.name, req.files.userPhoto.path, res);
|
uploadUserPicture(req.user.uid, req.files.userPhoto.name, req.files.userPhoto.path, res);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
function uploadUserPicture(uid, filename, tempPath, res) {
|
function uploadUserPicture(uid, filename, tempPath, res) {
|
||||||
@@ -165,8 +162,10 @@ var user = require('./../user.js'),
|
|||||||
dstPath: global.configuration['ROOT_DIRECTORY'] + uploadPath,
|
dstPath: global.configuration['ROOT_DIRECTORY'] + uploadPath,
|
||||||
width: 128
|
width: 128
|
||||||
}, function(err, stdout, stderr){
|
}, function(err, stdout, stderr){
|
||||||
if (err)
|
if (err) {
|
||||||
|
console.log(err);
|
||||||
throw err;
|
throw err;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user