DetectMediaType detects the base media type of the given file contents.
(data []byte)
| 50 | |
| 51 | // DetectMediaType detects the base media type of the given file contents. |
| 52 | func DetectMediaType(data []byte) string { |
| 53 | return BaseMediaType(mimetype.Detect(data).String()) |
| 54 | } |
| 55 | |
| 56 | // BaseMediaType strips parameters from a media type. |
| 57 | func BaseMediaType(mediaType string) string { |