possible fix for #516

v1.18.x
Baris Usakli 12 years ago
parent 7e4faa3270
commit 0b922d3f60

@ -64,6 +64,7 @@
nconf.set('url', nconf.get('base_url') + (nconf.get('use_port') ? ':' + nconf.get('port') : '') + nconf.get('relative_path') + '/');
nconf.set('upload_url', nconf.get('url') + 'uploads/');
nconf.set('base_dir', __dirname);
winston.info('Initializing NodeBB v' + pkg.version + ', on port ' + nconf.get('port') + ', using Redis store at ' + nconf.get('redis:host') + ':' + nconf.get('redis:port') + '.');
winston.info('NodeBB instance bound to: ' + ((nconf.get('bind_address') === "0.0.0.0" || !nconf.get('bind_address')) ? 'Any address (0.0.0.0)' : nconf.get('bind_address')));

@ -111,7 +111,7 @@ var user = require('./../user.js'),
}
var filename = 'site-logo' + extension;
var uploadPath = path.join(process.cwd(), nconf.get('upload_path'), filename);
var uploadPath = path.join(nconf.get('base_dir'), nconf.get('upload_path'), filename);
winston.info('Attempting upload to: ' + uploadPath);

@ -159,7 +159,7 @@ var user = require('./../user.js'),
return;
}
var absolutePath = path.join(process.cwd(), nconf.get('upload_path'), path.basename(oldpicture));
var absolutePath = path.join(nconf.get('base_dir'), nconf.get('upload_path'), path.basename(oldpicture));
fs.unlink(absolutePath, function (err) {
if (err) {
@ -181,7 +181,7 @@ var user = require('./../user.js'),
}
var filename = uid + '-profileimg' + extension;
var uploadPath = path.join(process.cwd(), nconf.get('upload_path'), filename);
var uploadPath = path.join(nconf.get('base_dir'), nconf.get('upload_path'), filename);
winston.info('Attempting upload to: ' + uploadPath);

Loading…
Cancel
Save