leeseohyeon

modifyFile.js 오타 수정

...@@ -22,7 +22,7 @@ router.post('/:name', function(req, res){ ...@@ -22,7 +22,7 @@ router.post('/:name', function(req, res){
22 if (curPath == '/') { 22 if (curPath == '/') {
23 targetPath = ''; 23 targetPath = '';
24 } else { 24 } else {
25 - targetPath = curPath.substring(1, curPaht.length-1); // folder1/folder2 25 + targetPath = curPath.substring(1, curPath.length-1); // folder1/folder2
26 } 26 }
27 27
28 var originalDir = __dirname + '/../modules/s3/download/' + user_id + curPath + file_name; 28 var originalDir = __dirname + '/../modules/s3/download/' + user_id + curPath + file_name;
...@@ -50,7 +50,7 @@ router.post('/:name', function(req, res){ ...@@ -50,7 +50,7 @@ router.post('/:name', function(req, res){
50 res.send({ error: 'update error' }); 50 res.send({ error: 'update error' });
51 } else { 51 } else {
52 fs.unlinkSync(tempDownloadDir); 52 fs.unlinkSync(tempDownloadDir);
53 - res.send('modify file success'); 53 + res.send({message: 'modify file success'});
54 } 54 }
55 }) 55 })
56 } else { 56 } else {
......
1 { 1 {
2 - "accessKeyId": "ASIAXZL2SWFE2KIQ3YTL", 2 + "accessKeyId": "ASIAZQ5XTMMFW4UZW2VT",
3 - "secretAccessKey": "BqniXH7AqxjndKHjxBWKjRkBOgRmSN8J6mgldm7C", 3 + "secretAccessKey": "xW8+UlKZwlWoFapKbCIWLylzm7Fu/NEp9I3Zm8ol",
4 - "sessionToken": "FwoGZXIvYXdzEIL//////////wEaDC6uNIWZKpDL9FekbiLDAb7ckeHQwp1tV2wu236TIia7VBtYMFQrLzkEm6sU7GiamzWfzrTCsQOOJXYMKzElNXD7dRckn30aVaw8xfNDgimqWdtk9O3x8jgCOp4gXk4KIUgtIFpN46qdGNxy28gL43voIf4O6n3boJaUum9bmejzmNlR8U4d6NfqMzrtJENs47Nl4fAiK8bIGlsznhr7MC5AUeZbV0d9uK7bkx1rn5zRRpR9WbbwofVIlK+YSEEHfQIJyLeJKDlprBXfqSTynCqkAyj8ovT2BTItQ8+cOmQXWuzPMA/Rbru2naLM3Hd2H8jEW6CMfPXvNAS+leVNDXuCY5r5Ebo9", 4 + "sessionToken": "FwoGZXIvYXdzEJr//////////wEaDCrmrozcBSyKdyzlniLDASuoWRbM8DUd4DsQqVjvJJVsuyegnxLuKZbs2nQvfAOA8X2mB5vakuykW6uNXXeyiY2keatkH5ksP07CEShFR/uoCuKHxqfV+5hglcylIeJvx4ruEvgdfyBw+u+emsSNPMYjqdc9zDgS7DZ1g9qPwUluEY+VIOhgURT15h3onCDIM7enhr4ba8iU+Nbx2ANjdTy3TGzwHnwupMZvAp8iGUt3yxlbopfIm6WtgjE2znMYGrz5/9V/S6hXCsNRVzTainyugCjc2Pn2BTItOpW51eRX99P1onvwOCN5Rh7psaflX4n+bGBhWIBuUh+jlFimntPBaKzmrB3V",
5 "region": "us-east-1" 5 "region": "us-east-1"
6 } 6 }
......
...@@ -14,9 +14,10 @@ ...@@ -14,9 +14,10 @@
14 14
15 15
16 var AWS = require('aws-sdk'); 16 var AWS = require('aws-sdk');
17 -AWS.config.update({ region: 'ap-northeast-2' }); 17 +//AWS.config.update({ region: 'ap-northeast-2' });
18 18
19 -var BUCKET_NAME = 'qkrrlqja-test'; 19 +//var BUCKET_NAME = 'qkrrlqja-test';
20 +var BUCKET_NAME = 'dkhuloud';
20 21
21 var s3 = new AWS.S3(); 22 var s3 = new AWS.S3();
22 var fs = require('fs'); 23 var fs = require('fs');
...@@ -337,10 +338,12 @@ var S3 = { ...@@ -337,10 +338,12 @@ var S3 = {
337 if (sourceFile == modiFile){ // 이름 변경되지 않은 경우 338 if (sourceFile == modiFile){ // 이름 변경되지 않은 경우
338 callback(true, sourceFile); 339 callback(true, sourceFile);
339 }else{ 340 }else{
341 + var targetFile;
340 if (targetPath != '') { 342 if (targetPath != '') {
341 - targetPath = targetpath + '/'; 343 + targetFile = targetPath + '/' + modiFile;
344 + }else{
345 + targetFile = modiFile;
342 } 346 }
343 - var targetFile = targetPath + modiFile;
344 347
345 S3.isFileOverlapped(bucketName, userId, targetFile, function (res, ans, lvNum) { 348 S3.isFileOverlapped(bucketName, userId, targetFile, function (res, ans, lvNum) {
346 if (!res) { 349 if (!res) {
......