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-05-28 23:11:55 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
805af94d9bc5ae9f6596e306c5145bc1b295ee0b
805af94d
1 parent
e717faad
db에 파일 위치 분리
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
8 deletions
backend/routes/file/deleteFile.js
backend/routes/file/downloadFile.js
backend/routes/file/files.js
backend/routes/file/uploadFile.js
backend/routes/file/deleteFile.js
View file @
805af94
...
...
@@ -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'
;
...
...
backend/routes/file/downloadFile.js
View file @
805af94
...
...
@@ -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
;
...
...
backend/routes/file/files.js
View file @
805af94
...
...
@@ -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
();
...
...
backend/routes/file/uploadFile.js
View file @
805af94
...
...
@@ -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
=
[];
...
...
Please
register
or
login
to post a comment