public async Task <ActionResult> GetFile(int id, string contentType) { var message = await ChatMessageManager.FindMessageAsync(id, AbpSession.GetUserId()); var jsonMessage = JObject.Parse(message.Message.Substring("[file]".Length)); using (CurrentUnitOfWork.SetTenantId(null)) { var fileObject = await BinaryObjectManager.GetOrNullAsync(Guid.Parse(((JValue)jsonMessage["id"]).Value.ToString())); if (fileObject == null) { return(StatusCode((int)HttpStatusCode.NotFound)); } return(File(fileObject.Bytes, contentType)); } }