Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2020-1-CloudComputing
/
C_Team_KhuDrive
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
윤창목
2020-06-17 21:25:05 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
ecbbba22f47e9fea8c06b1d35c71e3699b5616e5
ecbbba22
1 parent
e039af79
Fixed key issue
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
backend/api/views.py
backend/api/views.py
View file @
ecbbba2
...
...
@@ -195,14 +195,14 @@ class ItemViewSet(viewsets.ViewSet):
s3_bucket
=
AWS_STORAGE_BUCKET_NAME
item
=
Item
.
objects
.
filter
(
item_id
=
pk
)
object_
id
=
item
.
get
()
.
item_id
object_
name
=
item
.
get
()
.
name
data
=
serializers
.
serialize
(
"json"
,
item
)
json_data
=
json
.
loads
(
data
)
presigned_url
=
s3
.
generate_presigned_url
(
'get_object'
,
Params
=
{
'Bucket'
:
s3_bucket
,
'Key'
:
object_
id
},
'Key'
:
object_
name
},
ExpiresIn
=
3600
)
...
...
@@ -398,6 +398,7 @@ class ItemViewSet(viewsets.ViewSet):
# 파일 객체 생성
file_name
=
request
.
POST
.
get
(
'name'
,
''
)
file_size
=
request
.
POST
.
get
(
'size'
,
''
)
file_id
=
request
.
POST
.
get
(
'item_id'
,
''
)
file_parent
=
pk
file_type
=
mimetypes
.
guess_type
(
file_name
)[
0
]
upload_item
=
Item
(
name
=
file_name
,
size
=
file_size
,
user_id
=
1
,
file_type
=
file_type
,
parent
=
file_parent
)
...
...
Please
register
or
login
to post a comment