I'm downloading xml files that are compressed using GZip using System.NET.FtpWebRequest.
The files I receive are about twice the size as the files on the server and System.IO.Compression.GZipStream does not like them. It returns the following error message:
System.IO.InvalidDataException :
The magic number in GZip header is not correct.
Make sure you are passing in a GZip stream.
The GZip web site suggests many problems are caused by downloading binary files as ASCII. However, I'm getting the same problem whether I set UseBinary to true or false on FtpWebRequest.
My decompression code runs fine on files manually downloaded with FileZilla.
As usual your help is greatly appreciated.