From 3114d78b8bde4ed1a3ff7e8430adc2da97b68c44 Mon Sep 17 00:00:00 2001 From: Carson Katri Date: Wed, 23 Oct 2024 17:05:12 -0400 Subject: [PATCH] Pass mime type to fix file validation --- .../Stylesheets/Modifiers/Files/FileImporterModifier.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/LiveViewNative/Stylesheets/Modifiers/Files/FileImporterModifier.swift b/Sources/LiveViewNative/Stylesheets/Modifiers/Files/FileImporterModifier.swift index e0f142ce2..295056e9e 100644 --- a/Sources/LiveViewNative/Stylesheets/Modifiers/Files/FileImporterModifier.swift +++ b/Sources/LiveViewNative/Stylesheets/Modifiers/Files/FileImporterModifier.swift @@ -74,15 +74,15 @@ struct _FileImporterModifier: ViewModifier { let files = try result.get().map({ url in LiveFile( try Data(contentsOf: url), - url.pathExtension, - url.deletingPathExtension().lastPathComponent, + UTType(filenameExtension: url.pathExtension)!.preferredMIMEType!, + url.lastPathComponent, id ) }) Task { do { for file in files { - try await liveChannel.validateUpload(file) + print(try await liveChannel.validateUpload(file)) } } catch { logger.log(level: .error, "\(error.localizedDescription)")