leeseohyeon

modifyFile.js 오타 수정

......@@ -22,7 +22,7 @@ router.post('/:name', function(req, res){
if (curPath == '/') {
targetPath = '';
} else {
targetPath = curPath.substring(1, curPaht.length-1); // folder1/folder2
targetPath = curPath.substring(1, curPath.length-1); // folder1/folder2
}
var originalDir = __dirname + '/../modules/s3/download/' + user_id + curPath + file_name;
......@@ -50,7 +50,7 @@ router.post('/:name', function(req, res){
res.send({ error: 'update error' });
} else {
fs.unlinkSync(tempDownloadDir);
res.send('modify file success');
res.send({message: 'modify file success'});
}
})
} else {
......
{
"accessKeyId": "ASIAXZL2SWFE2KIQ3YTL",
"secretAccessKey": "BqniXH7AqxjndKHjxBWKjRkBOgRmSN8J6mgldm7C",
"sessionToken": "FwoGZXIvYXdzEIL//////////wEaDC6uNIWZKpDL9FekbiLDAb7ckeHQwp1tV2wu236TIia7VBtYMFQrLzkEm6sU7GiamzWfzrTCsQOOJXYMKzElNXD7dRckn30aVaw8xfNDgimqWdtk9O3x8jgCOp4gXk4KIUgtIFpN46qdGNxy28gL43voIf4O6n3boJaUum9bmejzmNlR8U4d6NfqMzrtJENs47Nl4fAiK8bIGlsznhr7MC5AUeZbV0d9uK7bkx1rn5zRRpR9WbbwofVIlK+YSEEHfQIJyLeJKDlprBXfqSTynCqkAyj8ovT2BTItQ8+cOmQXWuzPMA/Rbru2naLM3Hd2H8jEW6CMfPXvNAS+leVNDXuCY5r5Ebo9",
"accessKeyId": "ASIAZQ5XTMMFW4UZW2VT",
"secretAccessKey": "xW8+UlKZwlWoFapKbCIWLylzm7Fu/NEp9I3Zm8ol",
"sessionToken": "FwoGZXIvYXdzEJr//////////wEaDCrmrozcBSyKdyzlniLDASuoWRbM8DUd4DsQqVjvJJVsuyegnxLuKZbs2nQvfAOA8X2mB5vakuykW6uNXXeyiY2keatkH5ksP07CEShFR/uoCuKHxqfV+5hglcylIeJvx4ruEvgdfyBw+u+emsSNPMYjqdc9zDgS7DZ1g9qPwUluEY+VIOhgURT15h3onCDIM7enhr4ba8iU+Nbx2ANjdTy3TGzwHnwupMZvAp8iGUt3yxlbopfIm6WtgjE2znMYGrz5/9V/S6hXCsNRVzTainyugCjc2Pn2BTItOpW51eRX99P1onvwOCN5Rh7psaflX4n+bGBhWIBuUh+jlFimntPBaKzmrB3V",
"region": "us-east-1"
}
......
......@@ -14,9 +14,10 @@
var AWS = require('aws-sdk');
AWS.config.update({ region: 'ap-northeast-2' });
//AWS.config.update({ region: 'ap-northeast-2' });
var BUCKET_NAME = 'qkrrlqja-test';
//var BUCKET_NAME = 'qkrrlqja-test';
var BUCKET_NAME = 'dkhuloud';
var s3 = new AWS.S3();
var fs = require('fs');
......@@ -337,10 +338,12 @@ var S3 = {
if (sourceFile == modiFile){ // 이름 변경되지 않은 경우
callback(true, sourceFile);
}else{
var targetFile;
if (targetPath != '') {
targetPath = targetpath + '/';
targetFile = targetPath + '/' + modiFile;
}else{
targetFile = modiFile;
}
var targetFile = targetPath + modiFile;
S3.isFileOverlapped(bucketName, userId, targetFile, function (res, ans, lvNum) {
if (!res) {
......