-
Notifications
You must be signed in to change notification settings - Fork 31
Open
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomershacktoberfestA self-contained issue well-suited for HacktoberfestA self-contained issue well-suited for Hacktoberfest
Description
Is your feature request related to a problem? Please describe.
It would be useful to be able to set a custom attachment filename through the Content-Disposition header.
Why is your feature relevant to client-zip?
Makes it easier for downloading zip files with a custom filename.
Describe the solution you'd like
Can add filename to the options and then in downloadZip and then its a one-line change:
const headers: Record<string, any> = { "Content-Type": "application/zip", "Content-Disposition": options.filename ? `attachment; filename="${options.filename}"` : "attachment" }
Describe alternatives you've considered
It's possible to work around this currently by creating a new response, but is a bit more cumbersome to do:
let response = downloadZip(zip);
const headers = {
"Content-Disposition": `attachment; filename="${filename}"`,
"Content-Type": "application/zip"
};
response = new Response(response.body, {headers});
return response;
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomershacktoberfestA self-contained issue well-suited for HacktoberfestA self-contained issue well-suited for Hacktoberfest