Does the web client not return the compressed file properly?
If you wrote the data to a file and then used the uncompress program from the command line, you could determine if that is the problem. It's always a good idea to check that your data is good before attempting to debug your code.