Downloader alternatives and similar packages
Based on the "Tools" category.
Alternatively, view Downloader alternatives based on common mentions on social networks and blogs.
-
ShareX
ShareX is a free and open source program that lets you capture or record any area of your screen and share it with a single press of a key. It also allows uploading images, text or other types of files to many supported destinations you can choose from. -
Another Redis Desktop Manager
๐๐๐A faster, better and more stable redis desktop manager [GUI client], compatible with Linux, Windows, Mac. What's more, it won't crash when loading massive keys. -
YARP
A toolkit for developing high-performance HTTP reverse proxy applications. -
Visual Studio Uninstaller
Uninstall and clean up all components of Visual Studio. -
NETworkManager
A powerful tool for managing networks and troubleshoot network problems! -
Open Live Writer
An open source fork of Windows Live Writer -
UnitsNet
Makes life working with units of measurement just a little bit better. -
Myrtille
A native HTML4 / HTML5 Remote Desktop Protocol and SSH client -
SmartCode
SmartCode = IDataSource -> IBuildTask -> IOutput => Build Everything!!! -
Fake JSON Server
Fake JSON Server is a Fake REST API that can be used as a Back End for prototyping or as a template for a CRUD Back End. -
Mockaco
๐ต HTTP mock server, useful to stub services and simulate dynamic API responses, leveraging ASP.NET Core features, built-in fake data generation and pure C# scripting -
Workflow Server
Workflow Server is a ready-to-use Workflow Engine-based application that you can deploy into your infrastructure. It can be integrated with NodeJS, PHP, Ruby, .NET, or Java applications via a REST API. Workflow Server is a key component for managing the lifecycle of business objects within your enterprise. -
Infinity Crawler
A simple but powerful web crawler library for .NET -
FontAwesomeNet
Font-Awesome for .NET(Windows Forms and WPF). -
posh-dotnet
PowerShell tab completion and tooltip support for the dotnet CLI. -
JSON Formatter and Validator
A blazing fast JSON formatter and validator that won't share JSON with a server. -
CatLight
Build status notifications for TFS/Jenkins/Travis/Appveyor. Cross-platform desktop app based on .Net Core and Electron. [Free][Proprietary]
Static code analysis for 29 languages.
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of Downloader or a related project?
README
Downloader
:rocket: Fast, cross-platform and reliable multipart downloader with .Net Core supporting :rocket:
Downloader is a modern, fluent, asynchronous, testable and portable library for .NET. This is a multipart downloader with asynchronous progress events.
This library can added in your .Net Core v2
and later or .Net Framework v4.5
or later projects.
Downloader is compatible with .NET Standard 2.0 and above, running on Windows, Linux, and macOS, in full .NET Framework or .NET Core.
For a complete example see Downloader.Sample project from this repository.
Sample Console Application
Features at a glance
- Simple interface to make download request.
- Download files async and non-blocking.
- Download any type of files like image, video, pdf, apk and etc.
- Cross-platform library to download any files with any size.
- Get real-time progress info of each block.
- Download file multipart as parallel.
- Handle all the client-side and server-side exceptions non-stopping.
- Config your
ChunkCount
to define the parts count of the download file. - Download file multipart as
in-memory
oron-disk
mode. - Chunks are saved in parallel on the final file and not on the temp files.
- The file size is pre-allocated before the download starts.
- Store download package object to resume the download when you want.
- Get download speed or progress percentage in each progress event.
- Get download progress events per chunk downloads.
- Fast Pause and Resume downloads asynchronously.
- Stop and Resume downloads whenever you want with the package object.
- Supports large file download.
- Set a dynamic speed limit on downloads (changeable speed limitation on the go).
- Download files without storing on disk and get a memory stream for each downloaded file.
- Serializable download package (to/from
JSON
orBinary
) - Live streaming support, suitable for playing music at the same time as downloading.
- Ability to download just a certain range of bytes of a large file.
- Code is tiny, fast and does not depend on external libraries.
Installing via NuGet
PM> Install-Package Downloader
Installing via the .NET Core command line interface
dotnet add package Downloader
How to use
Step 1: Create your custom configuration
Simple Configuration
var downloadOpt = new DownloadConfiguration()
{
ChunkCount = 8, // file parts to download, default value is 1
ParallelDownload = true // download parts of file as parallel or not. Default value is false
};
Complex Configuration
Note: Do not use all of the below options in your applications, just add which one you need.
var downloadOpt = new DownloadConfiguration()
{
// usually, hosts support max to 8000 bytes, default values is 8000
BufferBlockSize = 10240,
// file parts to download, default value is 1
ChunkCount = 8,
// download speed limited to 2MB/s, default values is zero or unlimited
MaximumBytesPerSecond = 1024*1024*2,
// the maximum number of times to fail
MaxTryAgainOnFailover = 5,
// download parts of file as parallel or not. Default value is false
ParallelDownload = true,
// number of parallel downloads. The default value is the same as the chunk count
ParallelCount = 4,
// timeout (millisecond) per stream block reader, default values is 1000
Timeout = 1000,
// set true if you want to download just a specific range of bytes of a large file
RangeDownload = false,
// floor offset of download range of a large file
RangeLow = 0,
// ceiling offset of download range of a large file
RangeHigh = 0,
// clear package chunks data when download completed with failure, default value is false
ClearPackageOnCompletionWithFailure = true,
// minimum size of chunking to download a file in multiple parts, default value is 512
MinimumSizeOfChunking = 1024,
// Before starting the download, reserve the storage space of the file as file size, default value is false
ReserveStorageSpaceBeforeStartingDownload = true;
// config and customize request headers
RequestConfiguration =
{
Accept = "*/*",
CookieContainer = cookies,
Headers = new WebHeaderCollection(), // { your custom headers }
KeepAlive = true, // default value is false
ProtocolVersion = HttpVersion.Version11, // default value is HTTP 1.1
UseDefaultCredentials = false,
// your custom user agent or your_app_name/app_version.
UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64)",
Proxy = new WebProxy() {
Address = new Uri("http://YourProxyServer/proxy.pac"),
UseDefaultCredentials = false,
Credentials = System.Net.CredentialCache.DefaultNetworkCredentials,
BypassProxyOnLocal = true
}
}
};
Step 2: Create download service instance per download and pass your config
var downloader = new DownloadService(downloadOpt);
Step 3: Handle download events
// Provide `FileName` and `TotalBytesToReceive` at the start of each downloads
downloader.DownloadStarted += OnDownloadStarted;
// Provide any information about chunker downloads,
// like progress percentage per chunk, speed,
// total received bytes and received bytes array to live streaming.
downloader.ChunkDownloadProgressChanged += OnChunkDownloadProgressChanged;
// Provide any information about download progress,
// like progress percentage of sum of chunks, total speed,
// average speed, total received bytes and received bytes array
// to live streaming.
downloader.DownloadProgressChanged += OnDownloadProgressChanged;
// Download completed event that can include occurred errors or
// cancelled or download completed successfully.
downloader.DownloadFileCompleted += OnDownloadFileCompleted;
Step 4: Start the download with the url and file name
string file = @"Your_Path\fileName.zip";
string url = @"https://file-examples.com/fileName.zip";
await downloader.DownloadFileTaskAsync(url, file);
Step 4b: Start the download without file name
DirectoryInfo path = new DirectoryInfo("Your_Path");
string url = @"https://file-examples.com/fileName.zip";
// download into "Your_Path\fileName.zip"
await downloader.DownloadFileTaskAsync(url, path);
Step 4c: Download in MemoryStream
// After download completion, it gets a MemoryStream
Stream destinationStream = await downloader.DownloadFileTaskAsync(url);
How to pause and resume downloads quickly
When you want to resume a download quickly after pausing a few seconds. You can call the Pause
function of the downloader service. This way, streams stay alive and are only suspended by a locker to be released and resumed whenever you want.
// Pause the download
DownloadService.Pause();
// Resume the download
DownloadService.Resume();
How to stop and resume downloads other time
The โDownloadService
class has a property called Package
that stores each step of the download. To stopping the download you must call the CancelAsync
method. Now, if you want to continue again, you must call the same DownloadFileTaskAsync
function with the Package
parameter to resume your download. For example:
// At first, keep and store the Package file to resume
// your download from the last download position:
DownloadPackage pack = downloader.Package;
Stop or cancel download:
// This function breaks your stream and cancels progress.
downloader.CancelAsync();
Resuming download after cancelation:
await downloader.DownloadFileTaskAsync(pack);
So that you can even save your large downloads with a very small amount in the Package and after restarting the program, restore it again and start continuing your download. The packages are your snapshot of the download instance. Only the downloaded file addresses will be included in the package and you can resume it whenever you want. For more detail see StopResumeDownloadTest method
Note: Sometimes a server does not support downloading in a specific range. That time, we can't resume downloads after canceling. So, the downloader starts from the beginning.
Fluent download builder usage
For easy and fluent use of the downloader, you can use the DownloadBuilder
class. Consider the following examples:
Simple usage:
await DownloadBuilder.New()
.WithUrl(@"https://host.com/test-file.zip")
.WithDirectory(@"C:\temp")
.Build()
.StartAsync();
Complex usage:
IDownload download = DownloadBuilder.New()
.WithUrl(@"https://host.com/test-file.zip")
.WithDirectory(@"C:\temp")
.WithFileName("test-file.zip")
.WithConfiguration(new DownloadConfiguration())
.Build();
download.DownloadProgressChanged += DownloadProgressChanged;
download.DownloadFileCompleted += DownloadFileCompleted;
download.DownloadStarted += DownloadStarted;
download.ChunkDownloadProgressChanged += ChunkDownloadProgressChanged;
await download.StartAsync();
download.Stop(); // cancel current download
Resume the existing download package:
await DownloadBuilder.Build(package).StartAsync();
Resume the existing download package with a new configuration:
await DownloadBuilder.Build(package, config).StartAsync();
var download = DownloadBuilder.New()
.Build()
.WithUrl(url)
.WithFileLocation(path);
await download.StartAsync();
download.Pause(); // pause current download quickly
download.Resume(); // continue current download quickly
When does Downloader fail to download in multiple chunks?
Content-Length:
If your URL server does not provide the file size in the response header (Content-Length
).
The Downloader cannot split the file into multiple parts and continues its work with one chunk.
Accept-Ranges:
If the server return Accept-Ranges: none
in the responses header then that means the server does not support download in range and
the Downloader cannot use multiple chunking and continues its work with one chunk.
Content-Range:
At first, the Downloader sends a GET request to the server to fetch the file's size in the range.
If the server does not provide Content-Range
in the header then that means the server does not support download in range.
Therefore, the Downloader has to continue its work with one chunk.
How to serialize and deserialize downloader package
What is Serialization?
Serialization is the process of converting an object's state into information that can be stored for later retrieval or that can be sent to another system. For example, you may have an object that represents a document that you wish to save. This object could be serialized to a stream of binary information and stored as a file on disk. Later the binary data can be retrieved from the file and deserialized into objects that are exact copies of the original information. As a second example, you may have an object containing the details of a transaction that you wish to send to a non-.NET system. This information could be serialised to XML before being transmitted. The receiving system would convert the XML into a format that it could understand.
In this section, we want to show how to serialize download packages to JSON
text or Binary
, after stopping download to keep download data and resuming that every time you want.
You can serialize packages even using memory storage for caching download data which is used MemoryStream
.
JSON Serialization
Serializing the package to JSON
is very simple like this:
var packageJson = JsonConvert.SerializeObject(package);
Deserializing into the new package:
var newPack = JsonConvert.DeserializeObject<DownloadPackage>(packageJson);
For more detail see PackageSerializationTest method
Binary Serialization
To serialize or deserialize the package into a binary file, first you need serialize to JSON and next save it with BinaryWriter.
NOTE: The BinaryFormatter type is dangerous and is not recommended for data processing. Applications should stop using BinaryFormatter as soon as possible, even if they believe the data they're processing to be trustworthy. BinaryFormatter is insecure and can't be made secure. So, BinaryFormatter is deprecated and we can no longer support it. Reference
Instructions for Contributing
Welcome to contribute, feel free to change and open a PullRequest to develop branch. You can use either the latest version of Visual Studio or Visual Studio Code and .NET CLI for Windows, Mac and Linux.
For GitHub workflow, check out our Git workflow below this paragraph. We are following the excellent GitHub Flow process, and would like to make sure you have all of the information needed to be a world-class contributor!
Git Workflow
The general process for working with Downloader is:
- Fork on GitHub
- Make sure your line endings are correctly configured and fix your line endings!
- Clone your fork locally
- Configure the upstream repo (
git remote add upstream git://github.com/bezzad/downloader
) - Switch to the latest development branch (eg vX.Y.Z, using
git checkout vX.Y.Z
) - Create a local branch from that (
git checkout -b myBranch
). - Work on your feature
- Rebase if required
- Push the branch up to GitHub (
git push origin myBranch
) - Send a Pull Request on GitHub - the PR should target (have as base branch) the latest development branch (eg
vX.Y.Z
) rather thanmaster
.
We accept pull requests from the community. But, you should never work on a clone of master, and you should never send a pull request from master - always from a branch. Please be sure to branch from the head of the latest vX.Y.Z develop
branch (rather than master
) when developing contributions.
License
Licensed under the terms of the MIT License
Contributors
Thanks go to these wonderful people (List made with contrib.rocks):
*Note that all licence references and agreements mentioned in the Downloader README section above
are relevant to that project's source code only.