【问题标题】:Lotus notes DXL attachmentsLotus Notes DXL 附件
【发布时间】:2011-11-14 11:32:33
【问题描述】:

我尝试使用在线 base 64 解码器并成功解码文本和图片附件。

但是,当涉及到 MS word 和 Excel 附件时,我无法对其进行解码 您能否建议我正确的解码方法。

任何帮助表示赞赏!

【问题讨论】:

  • 发布您正在尝试处理的邮件的 MIME 标头,以便我们查看它们。
  • 样本编码字符串在此处page-monitor.com/Downloads/test.txt。我想解码上述内容并将其写入 docx 文件
  • 它似乎是有效的 base64 数据。你用什么来解码它?
  • System.Text.UTF8Encoding 编码器 = new System.Text.UTF8Encoding(); System.Text.Decoder utf8Decode = encoder.GetDecoder(); byte[] todecode_byte = Convert.FromBase64String(data); int charCount = utf8Decode.GetCharCount(todecode_byte, 0, todecode_byte.Length); char[] decoded_char = new char[charCount]; utf8Decode.GetChars(todecode_byte, 0, todecode_byte.Length, decoded_char, 0);结果 = 新字符串(decoded_char);
  • 如果 word 和 excel 文件是二进制文件,那么我想你可能不想经历 utf8Decode 步骤。

标签: lotus-notes


【解决方案1】:

如果 base64 解码仍然产生“垃圾内容” - 数据有可能也已被压缩(使用 Huffman 或 LZ1 方法)。检查其封闭标签的“压缩”属性值。

如果属性指示压缩 - 解压缩非常棘手。更好的办法是使用 DXLExporter 的 setUncompressAttachments(true) 模式再次导出 DXL。

【讨论】:

  • 感谢这么多年后的回复,我会要求我的团队在下一次构建中根据这些建议的更改进行工作。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-03-22
  • 1970-01-01
  • 2019-02-03
  • 1970-01-01
相关资源
最近更新 更多