최동원

Merge branch 'share,favorite' of http://khuhub.khu.ac.kr/2020-1-CloudComputing/D…

…_Team_Khuloud into share,favorite
...@@ -54,7 +54,7 @@ router.post('/makefolder', function(req, res, next) { ...@@ -54,7 +54,7 @@ router.post('/makefolder', function(req, res, next) {
54 let date = moment().format(); 54 let date = moment().format();
55 let params = { 55 let params = {
56 Bucket: BUCKET_NAME, 56 Bucket: BUCKET_NAME,
57 - Key: curPath + folder_name + '/', 57 + Key: 'drive/' + curPath + folder_name + '/',
58 Body: "", 58 Body: "",
59 ACL: "public-read-write" 59 ACL: "public-read-write"
60 }; 60 };
...@@ -104,7 +104,7 @@ router.post('/delfolder', function(req, res, next) { ...@@ -104,7 +104,7 @@ router.post('/delfolder', function(req, res, next) {
104 let folder_name = req.body.folder_name; 104 let folder_name = req.body.folder_name;
105 let params = { 105 let params = {
106 Bucket: BUCKET_NAME, 106 Bucket: BUCKET_NAME,
107 - Key: curPath + folder_name + '/' 107 + Key: 'drive/' + curPath + folder_name + '/'
108 }; 108 };
109 let checksql = 'SELECT * FROM folders WHERE location = ? AND folder_name = ? AND user_id = ?;'; 109 let checksql = 'SELECT * FROM folders WHERE location = ? AND folder_name = ? AND user_id = ?;';
110 let values = [cur, folder_name, user_id]; 110 let values = [cur, folder_name, user_id];
...@@ -160,12 +160,12 @@ router.post('/move', function(req, res, next) { ...@@ -160,12 +160,12 @@ router.post('/move', function(req, res, next) {
160 if (rows.length != 0) { 160 if (rows.length != 0) {
161 let copy_params = { 161 let copy_params = {
162 Bucket: BUCKET_NAME, 162 Bucket: BUCKET_NAME,
163 - CopySource: BUCKET_NAME + '/' + curPath + name + '/', 163 + CopySource: BUCKET_NAME + '/drive/' + curPath + name + '/',
164 - Key: newPath + name + '/' 164 + Key: 'drive/' + newPath + name + '/'
165 }; 165 };
166 let del_params = { 166 let del_params = {
167 Bucket: BUCKET_NAME, 167 Bucket: BUCKET_NAME,
168 - Key: curPath + name + '/' 168 + Key: 'drive/' + curPath + name + '/'
169 }; 169 };
170 s3.copyObject(copy_params, function(err, data) { 170 s3.copyObject(copy_params, function(err, data) {
171 if (err) { 171 if (err) {
...@@ -209,12 +209,12 @@ router.post('/move', function(req, res, next) { ...@@ -209,12 +209,12 @@ router.post('/move', function(req, res, next) {
209 if (rows.length != 0) { 209 if (rows.length != 0) {
210 let copy_params = { 210 let copy_params = {
211 Bucket: BUCKET_NAME, 211 Bucket: BUCKET_NAME,
212 - CopySource: BUCKET_NAME + '/' + curPath + file, 212 + CopySource: BUCKET_NAME + '/drive/' + curPath + file,
213 - Key: newPath + file 213 + Key: 'drive/' + newPath + file
214 }; 214 };
215 let del_params = { 215 let del_params = {
216 Bucket: BUCKET_NAME, 216 Bucket: BUCKET_NAME,
217 - Key: curPath + file 217 + Key: 'drive/' + curPath + file
218 }; 218 };
219 s3.copyObject(copy_params, function(err, data) { 219 s3.copyObject(copy_params, function(err, data) {
220 if (err) { 220 if (err) {
...@@ -267,12 +267,12 @@ router.post('/modify', function(req, res, next) { ...@@ -267,12 +267,12 @@ router.post('/modify', function(req, res, next) {
267 if (rows.length != 0) { 267 if (rows.length != 0) {
268 let copy_params = { 268 let copy_params = {
269 Bucket: BUCKET_NAME, 269 Bucket: BUCKET_NAME,
270 - CopySource: BUCKET_NAME + '/' + curPath + name + '/', 270 + CopySource: BUCKET_NAME + '/drive/' + curPath + name + '/',
271 - Key: curPath + newName + '/' 271 + Key: 'drive/' + curPath + newName + '/'
272 }; 272 };
273 let del_params = { 273 let del_params = {
274 Bucket: BUCKET_NAME, 274 Bucket: BUCKET_NAME,
275 - Key: curPath + name + '/' 275 + Key: 'drive/' + curPath + name + '/'
276 }; 276 };
277 s3.copyObject(copy_params, function(err, data) { 277 s3.copyObject(copy_params, function(err, data) {
278 if (err) { 278 if (err) {
......