another.im-ios/Monal/another.im/Helpers/URL+Extensions.swift
2024-11-19 17:07:51 +01:00

14 lines
338 B
Swift

import UniformTypeIdentifiers
extension URL {
var mimeType: String {
let pathExtension = self.pathExtension
if let uti = UTType(filenameExtension: pathExtension) {
return uti.preferredMIMEType ?? "application/octet-stream"
} else {
return "application/octet-stream"
}
}
}