38 lines
1012 B
TypeScript
38 lines
1012 B
TypeScript
|
|
export const ALLOWED_MIME_TYPES = new Set<string>([
|
||
|
|
'image/jpeg',
|
||
|
|
'image/png',
|
||
|
|
'image/gif',
|
||
|
|
'image/webp',
|
||
|
|
'application/pdf',
|
||
|
|
'application/msword',
|
||
|
|
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
||
|
|
'application/vnd.ms-excel',
|
||
|
|
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
||
|
|
'text/plain',
|
||
|
|
'text/csv',
|
||
|
|
]);
|
||
|
|
|
||
|
|
export const MIME_TO_EXT: Record<string, string> = {
|
||
|
|
'image/jpeg': 'jpg',
|
||
|
|
'image/png': 'png',
|
||
|
|
'image/gif': 'gif',
|
||
|
|
'image/webp': 'webp',
|
||
|
|
'application/pdf': 'pdf',
|
||
|
|
'application/msword': 'doc',
|
||
|
|
'application/vnd.openxmlformats-officedocument.wordprocessingml.document': 'docx',
|
||
|
|
'application/vnd.ms-excel': 'xls',
|
||
|
|
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet': 'xlsx',
|
||
|
|
'text/plain': 'txt',
|
||
|
|
'text/csv': 'csv',
|
||
|
|
};
|
||
|
|
|
||
|
|
export const MAX_FILE_SIZE = 52_428_800; // 50MB
|
||
|
|
|
||
|
|
export const PREVIEWABLE_MIMES = new Set<string>([
|
||
|
|
'image/jpeg',
|
||
|
|
'image/png',
|
||
|
|
'image/gif',
|
||
|
|
'image/webp',
|
||
|
|
'application/pdf',
|
||
|
|
]);
|