# mimeType property

String get mimeType

Determines the MIME type of the file based on its extension.

This extension method analyzes the file extension of the given string and returns the corresponding MIME type.

Returns:

The MIME type of the file.

Returns 'application/octet-stream' if the extension is not recognized.

## Implementation

    String get mimeType {
      final extension = split('.').last.toLowerCase();

      switch (extension) {
        case 'jpg':
        case 'jpeg':
          return 'image/jpeg';
        case 'png':
          return 'image/png';
        case 'gif':
          return 'image/gif';
        case 'bmp':
          return 'image/bmp';
        case 'webp':
          return 'image/webp';
        case 'mp4':
          return 'video/mp4';
        case 'avi':
          return 'video/x-msvideo';
        case 'mov':
          return 'video/quicktime';
        case 'mkv':
          return 'video/x-matroska';
        case 'webm':
          return 'video/webm';
        case '3gp':
          return 'video/3gpp';
        case 'wmv':
          return 'video/x-ms-wmv';
        case 'flv':
          return 'video/x-flv';
        case 'mpeg':
          return 'video/mpeg';
        case 'mpg':
          return 'video/mpeg';
        case 'm4v':
          return 'video/mp4';
        case 'ts':
          return 'video/mp2t';
        case '3g2':
          return 'video/3gpp2';
        case 'mp3':
          return 'audio/mpeg';
        case 'wav':
          return 'audio/wav';
        case 'aac':
          return 'audio/aac';
        case 'flac':
          return 'audio/flac';
        case 'ogg':
          return 'audio/ogg';
        case 'm4a':
          return 'audio/m4a';
        case 'amr':
          return 'audio/amr';
        default:
          return 'application/octet-stream';
      }
    }