feat(server): support tiff uploading (#513)

* feat(server): suport tiff uploading

* remove unused variable

Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
Thanh Pham
2022-08-23 02:49:17 +07:00
committed by GitHub
parent 9048be4c8e
commit ba2cda8955
3 changed files with 39 additions and 60 deletions

View File

@@ -9,7 +9,7 @@ import { randomUUID } from 'crypto';
export const assetUploadOption: MulterOptions = {
fileFilter: (req: Request, file: any, cb: any) => {
if (file.mimetype.match(/\/(jpg|jpeg|png|gif|mp4|x-msvideo|quicktime|heic|heif|dng|x-adobe-dng|webp)$/)) {
if (file.mimetype.match(/\/(jpg|jpeg|png|gif|mp4|x-msvideo|quicktime|heic|heif|dng|x-adobe-dng|webp|tiff)$/)) {
cb(null, true);
} else {
cb(new HttpException(`Unsupported file type ${extname(file.originalname)}`, HttpStatus.BAD_REQUEST), false);