是否可以通过 PHP 解压 SharpZipLib 压缩响应?
环境:Linux / MySQL / PHP
问题:连接到 Web 服务时,我收到使用 SharpZipLib .NET 库压缩的响应。到目前为止,我还无法找到在 .NET 环境之外解压缩这些响应的方法。
有谁知道在linux/php环境中解压这个的方法吗?谢谢!
Environment: Linux / MySQL / PHP
Problem: While connected to a webservice, I am getting a response that is compressed with the SharpZipLib .NET library. As of yet, I have not been able to find a way to decompress these responses outside of a .NET environment.
Does anyone know a way to decompress this in a linux/php environment? Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
查看他们的 API 文档,我看到可以从 PHP 可以读取的 SharpZipLib 中使用以下压缩算法:BZip2, Zip('压缩'), Zip.压缩,GZip,Tar, LZW。其中一些甚至注册为流过滤器,允许您以巧妙的方式链接它们,例如
file_get_contents('compress.zlib://http://domain/resource')
或file_get_contents('compress.bzip2://php://stdin')
。Looking at their API documentation, I see the following compression algorithms that can be used from SharpZipLib which PHP can read: BZip2, Zip ('Deflated'), Zip.Compression, GZip, Tar, LZW. Some of these are even registered as stream filters, allowing you to chain them in nifty ways such as
file_get_contents('compress.zlib://http://domain/resource')
orfile_get_contents('compress.bzip2://php://stdin')
.我最终使用了另一个提供非压缩响应的网络服务。然而,上面的信息很有用,只是不适用于这个特定问题。
I ended up using another web service provided that provided a non-compressed response. However the information above was useful, just not for this specific problem.