문제

I am trying to compress text server side in PHP using the gzdeflate function and send that data to the clients browser which will then inflate it.

I did some research and found the imaya Zlib.js source on GitHub and attempted to use that. Unfortunately, I always get an "unsupported compression method" error when I try to inflate my data.

I've read the documents with no luck and I have search the web for more information.

I found these two links, but wasn't able get any positive results.
ZLIB Decompression - Client Side
Decompress gzip and zlib string in javascript

Questions:
1) Are there any tutorials on how to use these libraries available?
2) If not would anyone have any information as to why I would be getting the error message that I am?

Thanks for any help or information that you can provide.

도움이 되었습니까?

해결책

http://www.php.net/manual/en/function.gzdeflate.php

  • gzencode() == gzip
  • gzcompress() == zlib (aka. HTTP deflate)
  • gzdeflate() == raw deflate encoding

I think that you must call gzcompress() for zlib compression.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top