mime 0.9.7

Dart native js
Flutter Android iOS web

Utilities for handling media (MIME) types, including determining a type from a file extension and file contents.

example/example.dart

import 'package:mime/mime.dart';

void main() {
  print(lookupMimeType('test.html'));
  // text/html

  print(lookupMimeType('test', headerBytes: [0xFF, 0xD8]));
  // image/jpeg

  print(lookupMimeType('test.html', headerBytes: [0xFF, 0xD8]));
  // image/jpeg
}
25
likes
110
pub points
99%
popularity

Utilities for handling media (MIME) types, including determining a type from a file extension and file contents.

Homepage

Documentation

API reference

Uploaders

dgrove@google.com
sigmund@google.com
kevmoo@google.com
kustermann@google.com

License

BSD (LICENSE)

More

Packages that depend on mime