Merge commit from fork
Co-authored-by: b4sh2 <b4sh2@users.noreply.github.com>
This commit is contained in:
parent
873c963043
commit
d6472f0876
1 changed files with 2 additions and 1 deletions
|
|
@ -2,6 +2,7 @@ import { MultipartFile } from '@fastify/multipart';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import { AttachmentType } from './attachment.constants';
|
import { AttachmentType } from './attachment.constants';
|
||||||
import { sanitizeFileName } from '../../common/helpers';
|
import { sanitizeFileName } from '../../common/helpers';
|
||||||
|
import { getMimeType } from '../../common/helpers/file.helper';
|
||||||
|
|
||||||
export interface PreparedFile {
|
export interface PreparedFile {
|
||||||
buffer?: Buffer;
|
buffer?: Buffer;
|
||||||
|
|
@ -40,7 +41,7 @@ export async function prepareFile(
|
||||||
fileName,
|
fileName,
|
||||||
fileSize,
|
fileSize,
|
||||||
fileExtension,
|
fileExtension,
|
||||||
mimeType: file.mimetype,
|
mimeType: getMimeType(file.originalname),
|
||||||
multiPartFile: file,
|
multiPartFile: file,
|
||||||
};
|
};
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue