Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
2.3k views
in .NET FTP by (120 points)
I am trying to unzip file as it is downloaded, by passing downloaded data stream directly into the decompressor. It would be easy if FTPClient.Get() would return a Stream object that I can pass on. Unfortunatelly, only FTPServer.Get(Stream,string) is available, that lets me put the content of the FTP file into the given stream. This defeats the purpose of Streams, as I have to create a MemoryStream or FileStream to temporarily hold the data, and if the file is large, it won't even fit into the MemoryStream.

I also noticed there is a protected virtual GetOutputStream(), but couldn't find any documentation.

Ideally, the code would look like this:


var gz = new GZipStream( FtpServer.GetStream(file), CompressionMode.Decompress );
// use gz as uncompressed data

1 Answer

0 votes
by (51.6k points)
Yes that would be a nice feature. Our Java product already has it, but we haven't gotten around to adding it to our .NET version yet.

- Hans (EnterpriseDT)

Categories

...