Created
September 16, 2016 20:23
-
-
Save framinosona/3f28dacf0db01bf596aea87af87d1a1b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected override async void OnNavigatedTo(NavigationEventArgs e) | |
{ | |
base.OnNavigatedTo(e); | |
Debug.WriteLine("Debut"); | |
var file = await SaveAsync(new Uri("Ton ZIP")); | |
Debug.WriteLine($"Downloaded : {file.Path}"); | |
} | |
public static async Task<StorageFile> SaveAsync( | |
Uri fileUri) | |
{ | |
var fileSavePicker = new FileSavePicker(); | |
fileSavePicker.DefaultFileExtension = ".zip"; | |
fileSavePicker.FileTypeChoices.Add(".zip Archive", new List<string> { ".zip" }); | |
fileSavePicker.SuggestedFileName = "Archive.zip"; | |
var outputFile = await fileSavePicker.PickSaveFileAsync(); | |
var downloader = new BackgroundDownloader(); | |
var download = downloader.CreateDownload( | |
fileUri, | |
outputFile); | |
var res = await download.StartAsync(); | |
return outputFile; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment