UPDATE - This library has now moved to the Shiny Framework at https://github.com/shinyorg/shiny
Cross platform HTTP download/upload manager
Platform | Version |
---|---|
iOS | 7+ |
Android | 4.3+ |
Windows UWP | 16299+ |
.NET Standard | 2.0 |
- Background Uploads & Downloads on each platform
- Supports transfer filtering based on metered connections (iOS & UWP only at the moment)
- Event Based Metrics
- Percentage Complete
- Total Bytes Expected
- Total Bytes Transferred
- Transfer Speed (Bytes Per Second)
- Estimated Completion Time
Be sure to install the Plugin.HttpTransferTasks nuget package in all of your main platform projects as well as your core/PCL project
Android
Add the following to your AndroidManifest.xml
<uses-permission android:name="android.permission.WAKE_LOCK"/>
// discover some devices
var task = CrossHttpTransfers.Current.Upload("http://somewheretosend.com", "<YOUR LOCAL FILEPATH>");
// when performing downloads, it is necessary to listen to where the temp file lands (this is due to iOS)
var task = CrossHttpTransfers.Current.Download("http://somewheretosend.com");
task.PropertyChanged += (sender, args) =>
{
if (task.Status != nameof(IHttpStatus.Task))
return;
if (task.Status == TaskStatus.Completed)
{
task.LocalFilePath // move this file appropriately here
}
};