Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2021-1-capstone-design1
/
RIT_Project1
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
1
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
박권수
2021-10-09 19:06:25 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
cc02f22857c9c74d2e31a32105f77840a4d869c9
cc02f228
1 parent
be191115
fix. gcs upload bug fix
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
server/src/util/GoogleCloudStorage.js
server/src/util/GoogleCloudStorage.js
View file @
cc02f22
...
...
@@ -41,17 +41,18 @@ exports.uploadQrCode = async ({ directory, qrCodeFileName }) => {
const
destination
=
qrCodeFileName
;
try
{
//파일을 GCS에 업로드
const
result
=
await
storage
.
bucket
(
'prescribe-medicine-qrcode'
).
upload
(
directory
+
qrCodeFileName
,
{
const
result
=
await
storage
.
bucket
(
'prescribe-medicine-qrcode'
).
upload
(
directory
+
'/'
+
qrCodeFileName
,
{
destination
});
//업로드 후 파일 삭제
fs
.
rm
(
directory
+
qrCodeFileName
,
()
=>
{});
fs
.
rm
(
directory
+
'/'
+
qrCodeFileName
,
()
=>
{});
const
qrCodeUrl
=
GoogleStorageUrl
+
`
${
result
[
0
].
bucket
.
id
}
/
${
result
[
0
].
name
}
`
;
return
qrCodeUrl
;
}
catch
(
e
)
{
console
.
log
(
e
);
return
null
;
}
};
...
...
Please
register
or
login
to post a comment