1

I am making an android app and a website that downloads info from a php script. The php script compresses the data using gzcompress($dat, 9);.

I know how to uncompressed it in android, but how do you do it in javascript?

In this post: Compress data in php and uncompress in javascript

sstringer mentions you can put a special header when using php's gzencode so jquery can automatically uncompress it. Is there a way for the way I am doing it?

Thanks

Community
  • 1
  • 1
omega
  • 40,311
  • 81
  • 251
  • 474

1 Answers1

0

I looked into this myself once. I decided to go to the ajax route and then redirect.

If you know where the file is being stored on the server you could post that to a php script which decompresses it and saves the file somewhere. Next, return this in the ajax response and then just redirect the user to the saved, decompressed file.

There is a project on GitHub: https://github.com/gcanu/gzip.js

That might be what you are looking for.

webmasterjunkie
  • 114
  • 1
  • 10