I have this C# code but the final esi.zip results in 0 length or basically empty. The URL does exist and confirms to download the file manually. I am baffled buy this.
Although this is an old thread, the so far given answers might not be sufficient to solve the "empty file" problem.
In case you are downloading from a https secure site, the "DownloadComplete" callback could indicate an error-free download, nevertheless the downloaded file might be empty. In my case, the advice given here helped. After adding the following line the download was ok:
System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;
webClient.DownloadFileAsync(new System.Uri(link), savePath);