This commit is contained in:
Cob-AI 2026-06-03 07:44:53 -07:00 • committed by GitHub
commit aff1a93fc8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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);
})
);