From a0ef96a6e1f0d5b0a5c60a36b31e47a83bb3a76b Mon Sep 17 00:00:00 2001 From: barisusakli Date: Fri, 2 Sep 2016 19:01:46 +0300 Subject: [PATCH] dont treat url as path, closes #5006 --- src/file.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/file.js b/src/file.js index 3920b3c271..a9d3ad207f 100644 --- a/src/file.js +++ b/src/file.js @@ -22,14 +22,13 @@ file.saveFileToLocal = function(filename, folder, tempPath, callback) { var uploadPath = path.join(nconf.get('base_dir'), nconf.get('upload_path'), folder, filename); - winston.verbose('Saving file '+ filename +' to : ' + uploadPath); + winston.verbose('Saving file '+ filename + ' to : ' + uploadPath); var is = fs.createReadStream(tempPath); var os = fs.createWriteStream(uploadPath); - is.on('end', function () { callback(null, { - url: path.join(nconf.get('upload_url'), folder, filename), + url: nconf.get('upload_url') + '/' + folder + '/' + filename, path: uploadPath }); });