leeseohyeon

db에 파일 위치 분리

......@@ -8,8 +8,7 @@ var S3 = require('../modules/s3/s3');
// /file/delete/:name
router.get('/:name', function (req, res) {
//var user_id = req.session.user_id;
var user_id = 'shlee';
var user_id = req.session.user_id;
var sourceFile = req.params.name;
var targetPath = 'trashcan';
......
......@@ -11,8 +11,7 @@ var S3 = require('../modules/s3/s3');
// /file/download/:name
router.get('/:name', function (req, res) {
var file_name = req.params.name;
//var user_id = req.session.user_id;
var user_id = 'shlee';
var user_id = req.session.user_id;
var sourceFile = file_name;
var tempDownloadDir = __dirname + '/../modules/s3/download/' + user_id + '/' + file_name;
......
......@@ -7,7 +7,7 @@ var S3 = require('../modules/s3/s3');
router.get('/', function (req, res) {
var user_id = req.query.user_id;
var user_id = req.session.user_id;
var sql = 'SELECT * FROM files WHERE user_id = (?) ORDER BY date DESC';
connection.query(sql, user_id, function (err, result) {
......@@ -22,7 +22,7 @@ router.get('/', function (req, res) {
// /file/:name
router.get('/:name', function (req, res) {
var file_name = req.params.name;
var user_id = req.query.user_id;
var user_id = req.session.user_id;
var s3 = new AWS.S3();
......
......@@ -11,8 +11,7 @@ var S3 = require('../modules/s3/s3');
// /file/upload
router.post('/', function (req, res) {
//var user_id = req.body.user_id;
var user_id = 'shlee';
var user_id = req.session.user_id;
var sourceFiles = [];
var errFiles = [];
......