| | | 1 | | namespace SVETA.Api.Helpers |
| | | 2 | | { |
| | | 3 | | public static class ContentTypeChecker |
| | | 4 | | { |
| | 0 | 5 | | public static string CheckContentType(string extension) => (extension ?? "").ToLower() switch |
| | 0 | 6 | | { |
| | 0 | 7 | | "7z" => "application/x-7z-compressed", |
| | 0 | 8 | | "pdf" => "application/pdf", |
| | 0 | 9 | | "bmp" => "image/bmp", |
| | 0 | 10 | | "bz" => "application/x-bzip", |
| | 0 | 11 | | "bz2" => "application/x-bzip2", |
| | 0 | 12 | | "csv" => "text/csv", |
| | 0 | 13 | | "djvu" => "image/vnd.djvu", |
| | 0 | 14 | | "gif" => "image/gif", |
| | 0 | 15 | | "jpeg" => "image/jpeg", |
| | 0 | 16 | | "jpg" => "image/jpeg", |
| | 0 | 17 | | "xls" => "application/vnd.ms-excel", |
| | 0 | 18 | | "xlsx" => "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", |
| | 0 | 19 | | "docx" => "application/vnd.openxmlformats-officedocument.wordprocessingml.document", |
| | 0 | 20 | | "doc" => "application/msword", |
| | 0 | 21 | | "png" => "image/png", |
| | 0 | 22 | | "rar" => "application/x-rar-compressed", |
| | 0 | 23 | | "tif" => "image/tiff", |
| | 0 | 24 | | "tar" => "application/x-tar", |
| | 0 | 25 | | "zip" => "application/zip", |
| | 0 | 26 | | _ => "" |
| | 0 | 27 | | }; |
| | | 28 | | } |
| | | 29 | | } |