another.im-ios/old/Helpers/URL+Extensions.swift
2024-08-11 13:09:29 +02: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"
}
}
}