接口返回的数据是二进制流,需先BASE64解码,再进行解压缩,压缩的文件格式为ZIP,需使用Inflater进行解压,即可得到文件。
java demo:
转成PHP代码:
贴上 原始二进制流数据,需要的同学可以自己测试一下:
$fileData = "eNrNlM9v0zAUx8/mr+CM3OL37CSNj/AXcOQOHDkgIf6fSaMFcViYklbrupSOFujakWU0lTYmVYgDYqhCoEmVtiHsuFHLRvlRqVLtxH7Psr/vfWzLpFaN+21v8yMl/sHr83LtTada3GhS8vLgeZjZug+e+KvabtU6pcw2KzJPK9UHUZeSpFgJuiW/biwzVgnCYTyKIkqqJ16cJPUBJf33ta/B0Oh3d8LhJMLEMzEmvrbMqnYSjcp7lJT3Gm3VfghWE5+S7ab/2RtkWW+frrfUzF48euepbHrBThrhe+xvfFk7MzqZN1HuHYaH1/eb1aMsvVbZCGnJ9vnW0dqZETNoGissaWGv0l/Z/0avEGTIcgA5FFeZKwVI5lBCCUOOjDFgaQFKbt9i4wIIwkU9iZK3p5rrBt7U26dUt6Ko9mnzlYoZRU2zielqh+UZM0vUSGpDXqgW81oyG6Pk0fSU6dZUG8Gx3WtpUaZO9RcEYNJC9f0LAv8/BH4ZgeXtBSAICSiZq4RZoQAcOKq/wBB+g6TM6Zpyay0AFKimgrAtAZbDhMUdQJ7halbvcdbnOieNY4M/hlUJw0VW3YoLrElxPdldiZpGJx69eBr82H3WOP7zFlxCtiRw9c2DLGYicxs517d5WZGd9KIu5JT1C/F35JxhfnD33sP7d0yoMQMsmN6WKKQF89Bbs+k5Wm4Bl/TAbSksKcQ8yPZsZE3N3eVFtiXM9ZI5s5FtLhT28iD/BGys22s=";
结果ok:
标签:文件,PHP,二进制,压缩,流转,CSV From: https://www.cnblogs.com/buckliu/p/16976761.html