You really need a download manager for files over 250MB. Your ISP [or anyone else on the route from your data to you] is likely to start caching data... not always correctly.
Your browser may be to blame - it would be simple enough to test another - but a download manager will stand you in good stead for many things. Lots of them have plugins to intercept browser downloads, so you don't forget & get a broken file.This is the advice section from an online service I use...
Personally, I've never tried their recommendation of ReGet - I'm on Mac & ReGet is Win-only software. As for PKZip - I've never had a broken zip file since I started using download managersDownloading large files over HTTP on the Internet can be tricky. To avoid the frustration of broken or corrupt downloads, observe the following suggestions when downloading from the Zip Manager: Never download any zip file or zip segment that is greater than 255 Megabytes (MB) in size. If your zip file is greater than 255 MB, use a download manager to split the download into multiple parts.
This is a limitation of broken, or misconfigured, web cache servers operated by your ISP. These cache servers behave in unexpected ways when transferring files greater than 255 MB in size. They can induce corruption, or premature session termination.
The cache servers are usually transparent. You can't tell they are in place until they corrupt a download.
Use a download manager when ever possible. Avoid downloading large zips with your web browser. Configure your download manager to split your download into numerous parts. Make sure that each download segment is less than 255 MB. For example, if your zip file is 800 MB in size, you need to split the download into 4 parts. The download manager will automatically combine the parts into one whole file.
Not only does using a download manager increase reliability of downloading large files over the Internet, they also increase your download speed.
We recommend ReGet as a download manager. ReGet supports SSL as well.
Do not try to resume a download on a different port then the download was started on. Your computer thinks that identical files on different ports are different files. If you switch ports, instead of resuming the file, your computer will start the download from the beginning.
If you must use a web browser to download from the Zip Manager, make sure the browser's cache is set to at least twice the size of the largest zip file you plan to download. If you are using IE, make sure to check both checkboxes under Tools|Internet Options|Advanced|HTTP 1.1 settings. You will have to restart your browser for these changes to take effect.
Make sure you have the newest firmware in your cable/dsl router. This is especially important for linksys routers. Older firmware versions contained incorrect MTU values that caused corruption at high speeds.
If you are unlucky enough to get a corrupt or broken zip file, use PKZip to repair the zip and recover as many files as possible. PKZip has the best repair algorithms compared to other utilities.
I was incorrectly trying to download the file using a URL like: .https://drive.google.com/open?id=UNIQUE_ID_HERE
Changes I made to my method:
url, is now a file object. I was passing the URL, but instead I should fetch the file using service.Files.Get() and using its Id.downloadfile for the file I want to download, I can call its DownloadAsync method, sending it the filestream I already had.The new code below:
private async Task DownloadFile(DriveService service, Google.Apis.Drive.v3.Data.File fileToDownload)
{
var downloader = new MediaDownloader(service);
downloader.ChunkSize = DownloadChunkSize;
// add a delegate for the progress changed event for writing to console on changes
downloader.ProgressChanged += Download_ProgressChanged;
var fileName = DownloadDirectoryName + @"\cover_new.pdf";
var downloadfile = service.Files.Get(fileToDownload.Id);
Console.WriteLine("Downloading file with id: {0}", fileToDownload);
using (var fileStream = new System.IO.FileStream(fileName, System.IO.FileMode.Create, System.IO.FileAccess.Write))
{
var progress = await downloadfile.DownloadAsync(fileStream);
if (progress.Status == DownloadStatus.Completed)
{
Console.WriteLine(fileName + " was downloaded successfully: " + progress.BytesDownloaded);
}
else
{
Console.WriteLine("Download {0} was interrupted in the middle. Only {1} were downloaded. ", fileName, progress.BytesDownloaded);
}
}
}
I hope this helps someone out there.