mirror of
https://github.com/BradGroux/veritas-kanban.git
synced 2026-10-01 09:21:20 +00:00
Fix content-disposition v2 import
This commit is contained in:
parent
578269963a
commit
53091069b7
1 changed files with 5 additions and 2 deletions
|
|
@ -2,7 +2,7 @@ import { Router, Request, Response } from 'express';
|
|||
import type { Router as RouterType } from 'express';
|
||||
import multer from 'multer';
|
||||
import { basename } from 'node:path';
|
||||
import { create as contentDisposition } from 'content-disposition';
|
||||
import * as contentDisposition from 'content-disposition';
|
||||
import { getTaskService } from '../services/task-service.js';
|
||||
import { getAttachmentService } from '../services/attachment-service.js';
|
||||
import { getTextExtractionService } from '../services/text-extraction-service.js';
|
||||
|
|
@ -163,7 +163,10 @@ router.get(
|
|||
const downloadName = basename(attachment.originalName.replace(/\\/g, '/'));
|
||||
|
||||
res.setHeader('Content-Type', attachment.mimeType);
|
||||
res.setHeader('Content-Disposition', contentDisposition(downloadName, { type: 'attachment' }));
|
||||
res.setHeader(
|
||||
'Content-Disposition',
|
||||
contentDisposition.create(downloadName, { type: 'attachment' })
|
||||
);
|
||||
res.sendFile(filepath);
|
||||
})
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue