diff --git a/Realtime/Message/LCIMFileMessage.cs b/Realtime/Message/LCIMFileMessage.cs index c06c38e..55aad4d 100644 --- a/Realtime/Message/LCIMFileMessage.cs +++ b/Realtime/Message/LCIMFileMessage.cs @@ -19,7 +19,10 @@ namespace LeanCloud.Realtime { public string Format { get { - return File.MimeType; + if (File.MetaData.TryGetValue("format", out object format)) { + return format as string; + } + return "unknown/unknown"; } } @@ -65,14 +68,14 @@ namespace LeanCloud.Realtime { Dictionary fileData = msgData["_lcfile"] as Dictionary; string objectId = fileData["objId"] as string; File = LCObject.CreateWithoutData(LCFile.CLASS_NAME, objectId) as LCFile; - if (fileData.TryGetValue("name", out object name)) { - File.Name = name as string; - } if (fileData.TryGetValue("url", out object url)) { File.Url = url as string; } if (fileData.TryGetValue("metaData", out object metaData)) { File.MetaData = metaData as Dictionary; + if (File.MetaData.TryGetValue("name", out object name)) { + File.Name = name as string; + } } } }