Replies: 1 comment
-
You can remove the export default {
async fetch(request, env, ctx) {
// ...
const zipFile = path.join(folder, `${fileName}.zip`);
const zipWriter = new ZipWriter(Writable.toWeb(fs.createWriteStream(zipFile)),{
password: filePwd,
encryptionStrength: 3
});
ctx.waitUntil(
(async () => {
// ...
await zipWriter.add(`${fileName}.${type}` Readable.toWeb(stream));
await zipWriter.close();
})()
);
return new Response(readable, {
headers: {
"Content-Disposition": 'attachment; filename="file.zip"',
"Content-Type": "application/zip",
"Cache-Control": "no-cache",
},
});
},
}; |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Beta Was this translation helpful? Give feedback.
All reactions