Skip to content

Commit

Permalink
chore: use .docx format for document download
Browse files Browse the repository at this point in the history
  • Loading branch information
nhsz committed Feb 8, 2022
1 parent fa4013b commit 8246cb8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/pages/api/download-application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
const response = await fetch(process.env.PROJECT_GRANTS_DOWNLOAD_FILE_URL!);
if (!response.ok) throw new Error(`unexpected response ${response.statusText}`);

res.setHeader('Content-Type', 'application/msword');
res.setHeader('Content-Disposition', 'attachment; filename=projectGrantsApplication.doc');
res.setHeader(
'Content-Type',
'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
);
res.setHeader('Content-Disposition', 'attachment; filename=projectGrantsApplication.docx');
res.send(response.body);
}

0 comments on commit 8246cb8

Please sign in to comment.