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:36:33 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
5c4481ad11b3416018f09fb955e80cfcded15540
5c4481ad
1 parent
aeed33ce
commit fixed views.py
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
backend/api/views.py
backend/api/views.py
View file @
5c4481a
...
...
@@ -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
)
...
...
@@ -407,7 +408,7 @@ class ItemViewSet(viewsets.ViewSet):
presigned_post
=
s3
.
generate_presigned_post
(
s3_bucket
,
file_
name
,
file_
id
,
{
"acl"
:
"private"
,
"Content-Type"
:
file_type
,
...
...
@@ -434,7 +435,7 @@ class ItemViewSet(viewsets.ViewSet):
data
=
{
"signed_url"
:
presigned_post
,
'url'
:
'
%
s/
%
s'
%
(
presigned_post
[
"url"
],
file_
name
),
'url'
:
'
%
s/
%
s'
%
(
presigned_post
[
"url"
],
file_
id
),
'item'
:
res
}
...
...
@@ -491,4 +492,4 @@ class SharedItemViewSet(viewsets.ModelViewSet):
item
=
ItemViewSet
.
as_view
({
'delete'
:
'destroy'
,
})
\ No newline at end of file
})
...
...
Please
register
or
login
to post a comment