可以PHP解压缩使用.NET GZipStream类压缩的文件吗? [英] Can PHP decompress a file compressed with the .NET GZipStream class?

查看:382
本文介绍了可以PHP解压缩使用.NET GZipStream类压缩的文件吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个C#应用程序,与基于PHP的SOAP Web服务进行通信,以获取更新和许可。

I have a C# application that communicates with a PHP-based SOAP web service for updates and licensing.

我现在正在开发一个反馈系统,错误和跟踪日志自动通过软件。基于上一个问题,我发布,我觉得一个Web服务是最好的方法(最有可能工作正常与最少的配置)。

I am now working on a feedback system for users to submit errors and tracelogs automatically through the software. Based on a previous question I posted, I felt that a web service would be the best way to do it (most likely to work properly with least configuration).

我的当前想到的是使用.NET内置的gzip压缩来压缩文本文件,转换为base64,发送到web服务,并让PHP脚本转换为二进制和解压缩数据。

My current thought is to use .NET built-in gzip compression to compress the text file, convert to base64, send to the web-service, and have the PHP script convert to binary and uncompress the data.

可以PHP解压缩用GZipStream压缩的数据,如果是这样,如何?

Can PHP decompress data compressed with GZipStream, and if so, how?

推荐答案

GZipStream不工作。另一方面,在.NET端使用DeflateStream进行压缩,并在PHP端使用gzinflate进行解压缩。您的里程可能不同...

I actually tried this. GZipStream doesn't work. On the other hand, compressing with DeflateStream on .NET side and decompressing with gzinflate on PHP side do work. Your mileage may vary...

这篇关于可以PHP解压缩使用.NET GZipStream类压缩的文件吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆