简体   繁体   English

PHP提取邮政编码字符串

[英]PHP Extract zip string

I have an integration project with ERP system that return me a list of invoices compressed with zip as binary string: 我有一个与ERP系统的集成项目,该项目返回给我一张以zip压缩为二进制字符串的发票清单:

Xc1NCsIwEEDhq0j2ZuIPCEWF4qqgNNCN2yFWGzAzMhmMvb1g0YUHeN/b1iI4tlcvkSXq2NCTY+hnr3SnvDOD6qMCyGHoE2Z7QcXApIJBLcsNls6twW1gyn3b1b6xB06Jyf6R2UxoFX9sKcWW1RdawPl07D6neaSsSKE3sH8D Xc1NCsIwEEDhq0j2ZuIPCEWF4qqgNNCN2yFWGzAzMhmMvb1g0YUHeN / b1iI4tlcvkSXq2NCTY + hnr3SnvDOD6qMCyGHoE2Z7QcXApIJBLcsNS6W6B1S7K3S6K3S6K6S3B6

I can't success to extract it, I try with gzuncompress() , new ArchiverZip() also try to convert it from bin2hex , base64 ... and nothing, I should get an object from this string. 我无法成功提取它,我尝试使用gzuncompress()new ArchiverZip()也尝试将其从bin2hexbase64转换为……,什么也没有,我应该从此字符串中获取一个对象。

The guys which develop the ERP system, told me that they are compress it with Ionic (??): Ionic.Zlib.DeflateStream.UncompressBuffer(compressedData); 开发ERP系统的人告诉我,他们正在使用Ionic(??)进行Ionic.Zlib.DeflateStream.UncompressBuffer(compressedData);Ionic.Zlib.DeflateStream.UncompressBuffer(compressedData);

Any ideas ? 有任何想法吗 ? Thanks 谢谢

That data is compressed with raw deflate (no zlib, gzip, or zip wrapper around the deflate data), and base64 encoded. 该数据使用原始deflate压缩(在deflate数据周围没有zlib,gzip或zip包装器),并以base64编码。 Decoded and decompressed, it's: 经过解码和解压缩的是:

<ArrayOfPriorityInvoice xmlns="http://schemas.datacontract.org/2004/07/PrioriPOSAPI.Common.PriorityInvoices" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"/>

Use base64_decode() and gzinflate() to extract the data. 使用base64_decode()gzinflate()提取数据。

Try to read the string using file_get_contents 尝试使用file_get_contents读取字符串

Then write a zip file into a tmp folder, then extract it 然后将zip文件写入tmp文件夹,然后解压缩

Tell me if you need further explaination 告诉我是否需要进一步的解释

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM