Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2020-1-CloudComputing
/
D_Team_Khuloud
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
leeseohyeon
2020-06-09 03:04:27 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
61b6572b6451d11f86aa16e90ec6e57be8165efa
61b6572b
1 parent
9abeab90
modifyFile.js 오타 수정
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
9 deletions
backend/routes/file/modifyFile.js
backend/routes/modules/awsconfig.json
backend/routes/modules/s3/s3.js
backend/routes/file/modifyFile.js
View file @
61b6572
...
...
@@ -22,7 +22,7 @@ router.post('/:name', function(req, res){
if
(
curPath
==
'/'
)
{
targetPath
=
''
;
}
else
{
targetPath
=
curPath
.
substring
(
1
,
curPa
ht
.
length
-
1
);
// folder1/folder2
targetPath
=
curPath
.
substring
(
1
,
curPa
th
.
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
{
...
...
backend/routes/modules/awsconfig.json
View file @
61b6572
{
"accessKeyId"
:
"ASIA
XZL2SWFE2KIQ3YTL
"
,
"secretAccessKey"
:
"
BqniXH7AqxjndKHjxBWKjRkBOgRmSN8J6mgldm7C
"
,
"sessionToken"
:
"FwoGZXIvYXdzE
IL//////////wEaDC6uNIWZKpDL9FekbiLDAb7ckeHQwp1tV2wu236TIia7VBtYMFQrLzkEm6sU7GiamzWfzrTCsQOOJXYMKzElNXD7dRckn30aVaw8xfNDgimqWdtk9O3x8jgCOp4gXk4KIUgtIFpN46qdGNxy28gL43voIf4O6n3boJaUum9bmejzmNlR8U4d6NfqMzrtJENs47Nl4fAiK8bIGlsznhr7MC5AUeZbV0d9uK7bkx1rn5zRRpR9WbbwofVIlK+YSEEHfQIJyLeJKDlprBXfqSTynCqkAyj8ovT2BTItQ8+cOmQXWuzPMA/Rbru2naLM3Hd2H8jEW6CMfPXvNAS+leVNDXuCY5r5Ebo9
"
,
"accessKeyId"
:
"ASIA
ZQ5XTMMFW4UZW2VT
"
,
"secretAccessKey"
:
"
xW8+UlKZwlWoFapKbCIWLylzm7Fu/NEp9I3Zm8ol
"
,
"sessionToken"
:
"FwoGZXIvYXdzE
Jr//////////wEaDCrmrozcBSyKdyzlniLDASuoWRbM8DUd4DsQqVjvJJVsuyegnxLuKZbs2nQvfAOA8X2mB5vakuykW6uNXXeyiY2keatkH5ksP07CEShFR/uoCuKHxqfV+5hglcylIeJvx4ruEvgdfyBw+u+emsSNPMYjqdc9zDgS7DZ1g9qPwUluEY+VIOhgURT15h3onCDIM7enhr4ba8iU+Nbx2ANjdTy3TGzwHnwupMZvAp8iGUt3yxlbopfIm6WtgjE2znMYGrz5/9V/S6hXCsNRVzTainyugCjc2Pn2BTItOpW51eRX99P1onvwOCN5Rh7psaflX4n+bGBhWIBuUh+jlFimntPBaKzmrB3V
"
,
"region"
:
"us-east-1"
}
...
...
backend/routes/modules/s3/s3.js
View file @
61b6572
...
...
@@ -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
)
{
...
...
Please
register
or
login
to post a comment