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:39 +0900
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
c7927d514a55fa389a0d92a0147907c9de70932d
c7927d51
2 parents
4e9bd5d6
cc02f228
Merge branch 'server' into web
Show 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 @
c7927d5
...
...
@@ -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