mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 03:55:55 +01:00
upload_url shouldn't use path.join
This commit is contained in:
@@ -8,6 +8,7 @@ var fs = require('fs'),
|
||||
var file = {};
|
||||
|
||||
file.saveFileToLocal = function(filename, tempPath, callback) {
|
||||
|
||||
var uploadPath = path.join(nconf.get('base_dir'), nconf.get('upload_path'), filename);
|
||||
|
||||
winston.info('Saving file '+ filename +' to : ' + uploadPath);
|
||||
@@ -17,7 +18,7 @@ file.saveFileToLocal = function(filename, tempPath, callback) {
|
||||
|
||||
is.on('end', function () {
|
||||
callback(null, {
|
||||
url: (nconf.get('upload_url') + filename).split(path.sep).join('/')
|
||||
url: nconf.get('upload_url') + filename
|
||||
});
|
||||
});
|
||||
|
||||
@@ -29,6 +30,4 @@ file.saveFileToLocal = function(filename, tempPath, callback) {
|
||||
is.pipe(os);
|
||||
};
|
||||
|
||||
module.exports = file;
|
||||
|
||||
|
||||
module.exports = file;
|
Reference in New Issue
Block a user