document link disable

This commit is contained in:
2022-02-16 07:17:20 +00:00
parent bfc4a7f3ab
commit f7dd728696
39 changed files with 2021 additions and 2079 deletions
+9 -1
View File
@@ -64,6 +64,9 @@ export default async function ApiProxy(req, res) {
configDocument(token.access_token)
)
.then((response) => {
const bytes = response.data.byteLength;
console.log(bytes);
res.setHeader(
"content-disposition",
"attachment; filename=" +
@@ -71,7 +74,12 @@ export default async function ApiProxy(req, res) {
"filename="
)[1]
);
res.status(200).send(response.data);
return res.status(200).send(response.data);
})
.then(() => {
console.log("has downloaded");
return "downloadComplete";
})
.catch(({ err }) => {
res.status(400).json(err);