From dcff11e18831849b9cf15b95de432ca4fc450df9 Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Thu, 29 Oct 2020 09:49:22 +0100 Subject: [PATCH] fix mime type --- lib/src/message_input.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/src/message_input.dart b/lib/src/message_input.dart index 577ba172..36613f3a 100644 --- a/lib/src/message_input.dart +++ b/lib/src/message_input.dart @@ -814,7 +814,7 @@ class MessageInputState extends State { } Future _uploadImage(PlatformFile file, Channel channel) async { - final filename = file.name; + final filename = file.name ?? file.path?.split('/')?.last; final bytes = file.bytes; final res = await channel.sendImage( MultipartFile.fromBytes( @@ -827,7 +827,7 @@ class MessageInputState extends State { } Future _uploadFile(PlatformFile file, Channel channel) async { - final filename = file.name; + final filename = file.name ?? file.path?.split('/')?.last; final bytes = file.bytes; final res = await channel.sendFile( MultipartFile.fromBytes(