Skip to content

Commit

Permalink
Chore: #115 허용하는 파일 확장자 constants로 정리
Browse files Browse the repository at this point in the history
  • Loading branch information
Seok93 committed Sep 27, 2024
1 parent 67236be commit f3f68f0
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
44 changes: 44 additions & 0 deletions src/constants/mimeFileType.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// 이미지 파일
export const JPG = 'image/jpeg';
export const PNG = 'image/png';
export const SVG = 'image/svg+xml';
export const WEBP = 'image/webp';

// 압축 파일
export const ZIP = 'application/zip';
export const RAR = 'application/x-rar-compressed';
export const Z7 = 'application/x-7z-compressed';
export const ALZ = 'application/x-alz';
export const EGG = 'application/x-egg';

// 문서 파일
export const TXT = 'text/plain';
export const PDF = 'application/pdf';
export const HWP = 'application/x-hwp';
export const DOC = 'application/msword';
export const XLS = 'application/vnd.ms-excel';
export const PPT = 'application/vnd.ms-powerpoint';
export const DOCX = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';
export const XLSX = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
export const PPTX = 'application/vnd.openxmlformats-officedocument.presentationml.presentation';

export const TASK_ACCEPT_FILE_TYPES = [
JPG,
PNG,
SVG,
WEBP,
ZIP,
RAR,
Z7,
ALZ,
EGG,
PDF,
TXT,
HWP,
DOC,
XLS,
PPT,
DOCX,
XLSX,
PPTX,
];
2 changes: 2 additions & 0 deletions src/constants/settings.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { DAY, MB, MINUTE, SECOND } from '@constants/units';
import { TASK_ACCEPT_FILE_TYPES } from '@constants/mimeFileType';

export const AUTH_SETTINGS = Object.freeze({
// ACCESS_TOKEN_EXPIRATION: 5 * SECOND, // 테스트용 5초
Expand All @@ -21,4 +22,5 @@ export const USER_SETTINGS = Object.freeze({
export const TASK_SETTINGS = Object.freeze({
MAX_FILE_SIZE: 2 * MB,
MAX_FILE_COUNT: 10,
FILE_TYPES: TASK_ACCEPT_FILE_TYPES,
});

0 comments on commit f3f68f0

Please sign in to comment.