another.im-ios/ConversationsClassic/Helpers/URL+Extensions.swift

14 lines
338 B
Swift
Raw Normal View History

2024-07-14 18:28:54 +00:00
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"
}
}
}