From 51a7d163be4e985ae2c30ce977bacebf9394a35c Mon Sep 17 00:00:00 2001 From: psychobunny Date: Thu, 17 Apr 2014 13:11:53 -0400 Subject: [PATCH] fixes #1396 --- src/file.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/file.js b/src/file.js index 46044c3c6b..4d0068dabf 100644 --- a/src/file.js +++ b/src/file.js @@ -1,3 +1,5 @@ +"use strict"; + var fs = require('fs'), nconf = require('nconf'), path = require('path'), @@ -6,7 +8,6 @@ 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); @@ -16,7 +17,7 @@ file.saveFileToLocal = function(filename, tempPath, callback) { is.on('end', function () { callback(null, { - url: nconf.get('upload_url') + filename + url: (nconf.get('upload_url') + filename).split(path.sep).join('/') }); }); @@ -26,7 +27,7 @@ file.saveFileToLocal = function(filename, tempPath, callback) { }); is.pipe(os); -} +}; module.exports = file;