v1.18.x
psychobunny 11 years ago
parent 5b38c3b9ee
commit 51a7d163be

@ -1,3 +1,5 @@
"use strict";
var fs = require('fs'), var fs = require('fs'),
nconf = require('nconf'), nconf = require('nconf'),
path = require('path'), path = require('path'),
@ -6,7 +8,6 @@ var fs = require('fs'),
var file = {}; var file = {};
file.saveFileToLocal = function(filename, tempPath, callback) { file.saveFileToLocal = function(filename, tempPath, callback) {
var uploadPath = path.join(nconf.get('base_dir'), nconf.get('upload_path'), filename); var uploadPath = path.join(nconf.get('base_dir'), nconf.get('upload_path'), filename);
winston.info('Saving file '+ filename +' to : ' + uploadPath); winston.info('Saving file '+ filename +' to : ' + uploadPath);
@ -16,7 +17,7 @@ file.saveFileToLocal = function(filename, tempPath, callback) {
is.on('end', function () { is.on('end', function () {
callback(null, { 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); is.pipe(os);
} };
module.exports = file; module.exports = file;

Loading…
Cancel
Save