mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-27 13:10:56 +00:00
21 lines
841 B
TypeScript
21 lines
841 B
TypeScript
import { SUPPORT_ATTACHMENT_MAX_BYTES, SUPPORT_ATTACHMENT_MAX_PER_MESSAGE } from '@edr/types';
|
|
import { MulterOptions } from '@nestjs/platform-express/multer/interfaces/multer-options.interface';
|
|
|
|
/** Multipart field name carrying chat files. */
|
|
export const SUPPORT_ATTACHMENT_FIELD = 'attachments';
|
|
|
|
/**
|
|
* Multer-level caps for the chat send routes.
|
|
*
|
|
* These duplicate `SupportService.assertSendable` on purpose and don't replace
|
|
* it: Multer stops reading the socket once a part exceeds `fileSize`, so an
|
|
* oversized upload is cut off mid-stream rather than buffered into memory and
|
|
* rejected afterwards. The service check produces the readable error.
|
|
*/
|
|
export const supportAttachmentMulterOptions: MulterOptions = {
|
|
limits: {
|
|
fileSize: SUPPORT_ATTACHMENT_MAX_BYTES,
|
|
files: SUPPORT_ATTACHMENT_MAX_PER_MESSAGE,
|
|
},
|
|
};
|