How to download tgz file from a url and decompress it efficiently? I have a .tgz file that I need to download given a url inside a Testing folder and then decompress it. I am able to download the .tgz file successfully from the url and also able to successfully decompress it without any issues. My .tgz file will be approx 100 MB max. I am using SharpZipLib library here to decompress.
There are two parts to this:

Download .tgz file from a url in a particular folder.
If file is downloaded successfully then only decompress .tgz file in that same folder othewise not.

Below is my code:
private void DownloadTGZFile(string url, string fileToDownload)
{
    using (var client = new WebClient())
    {
        client.DownloadFile(url + fileToDownload, &quot;Testing/configs.tgz&quot;);
    }
    Stream inStream = File.OpenRead(&quot;Testing/configs.tgz&quot;);
    Stream gzipStream = new GZipInputStream(inStream);

    TarArchive tarArchive = TarArchive.CreateInputTarArchive(gzipStream);
    tarArchive.ExtractContents(&quot;Testing/&quot;);
    tarArchive.Close();

    gzipStream.Close();
    inStream.Close();
}

Question:
I wanted to check on below things:

Is using WebClient efficient here? If not, then what can I use to download the file efficiently for me considering file size is 100 MB max?
Also can I add a timeout here so that if I am not able to download the file in that time period, then it just times out. But it should retry for 3 times (or with some retry policy) and skip it if not able to by logging an error for the last try.
And if it is able to download the .tgz file successfully then decompress it in the same folder.

I am a newbie who started working with C# so still confuse on usage of WebClient and not sure if it is the right way to do it also. And this will be a production code so wanted to see what's the best way to re-write this whole code if there is any.
DownloadTGZFile does two things, which is one thing too many.

It does what it name says it does (download a .TGZ file),
but it also unpacks the TGZ file, and that is not in the method's name.

Unpacking the file should be a different method. You should then have a new method that calls both methods.

Also, please follow the Microsoft guidelines:

The PascalCasing convention, used for all identifiers except parameter
names, capitalizes the first character of each word (including
acronyms over two letters in length), as shown in the following
examples:
PropertyDescriptor HtmlTag
A special case is made for two-letter acronyms in which both letters
are capitalized, as shown in the following identifier:
IOStream

Thus the method name should be DownloadTgzFile.