You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Microsoft Dynamics Business Central中[Tenant Media]表图片读取与镜像疑问

Microsoft Dynamics Business Central Tenant Media表图片内容处理
  • Tenant Media表的Content字段内容未加密,而是通过DEFLATE压缩算法进行了压缩处理
  • 将该字段读取为byte[]后,只需通过DEFLATE解压即可还原出原始图片的二进制数据,能正常获取有效图片

C#解压示例代码

using System.IO;
using System.IO.Compression;

public byte[] GetOriginalImageBytes(byte[] compressedContent)
{
    using var inputMs = new MemoryStream(compressedContent);
    // 跳过DEFLATE格式的前2字节标识
    inputMs.ReadByte();
    inputMs.ReadByte();
    
    using var deflateStream = new DeflateStream(inputMs, CompressionMode.Decompress);
    using var outputMs = new MemoryStream();
    
    deflateStream.CopyTo(outputMs);
    return outputMs.ToArray();
}

内容的提问来源于stack exchange,提问作者pepr

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.19 02:04:56