diff --git a/src/pages/api/upload/media.ts b/src/pages/api/upload/media.ts index a182c48..a69ff6c 100644 --- a/src/pages/api/upload/media.ts +++ b/src/pages/api/upload/media.ts @@ -21,8 +21,13 @@ interface UploadResult { const UPLOAD_CONFIG = { maxFileSize: 50 * 1024 * 1024, // 50MB allowedTypes: new Set([ + // Images 'image/jpeg', 'image/jpg', 'image/png', 'image/gif', 'image/webp', 'image/svg+xml', + + // Videos 'video/mp4', 'video/webm', 'video/ogg', 'video/avi', 'video/mov', + + // Documents 'application/pdf', 'application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', @@ -30,7 +35,32 @@ const UPLOAD_CONFIG = { 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/vnd.ms-powerpoint', 'application/vnd.openxmlformats-officedocument.presentationml.presentation', - 'text/plain', 'text/csv', 'application/json' + + // Text files + 'text/plain', + 'text/csv', + 'text/markdown', // Added markdown + 'text/x-markdown', // Alternative markdown MIME type + 'application/json', + 'application/xml', + 'text/xml', + 'text/html', + + // Archives + 'application/zip', + 'application/x-tar', + 'application/gzip', + 'application/x-gzip', + 'application/x-zip-compressed', + 'application/x-rar-compressed', + 'application/x-7z-compressed', + + // Additional useful formats + 'application/rtf', // Rich Text Format + 'text/richtext', + 'application/x-yaml', // YAML files + 'text/yaml', + 'application/yaml' ]), localUploadPath: process.env.LOCAL_UPLOAD_PATH || './public/uploads', publicBaseUrl: process.env.PUBLIC_BASE_URL || 'http://localhost:4321' diff --git a/src/pages/contribute/knowledgebase.astro b/src/pages/contribute/knowledgebase.astro index 5863579..31af7d0 100644 --- a/src/pages/contribute/knowledgebase.astro +++ b/src/pages/contribute/knowledgebase.astro @@ -114,8 +114,13 @@ const sortedTools = data.tools.sort((a: any, b: any) => a.name.localeCompare(b.n