Skip to content

A package containing an uploader for uploading to an Azure SAS Url.

Notifications You must be signed in to change notification settings

JakeLunn/AzureSasUploader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

How to use

Simple example:

var mySasUrl = "https://myazuresasurl.com?helloiamasasurl";
var pathToFile = "C:\\myfile.txt";

var uploader = new AzureSasUploader(mySasUrl);

await uploader.UploadFileAsync(pathToFile);

The uploader has an event hook called ProgressChanged which reports upload progress. This event is fired every time the uploader finishes uploading a chunk.

uploader.ProgressChanged += (caller, progressPercent) => 
{
    //Log progress
    Console.WriteLine($"Upload Progress: {progressPercent}%");
}

await uploader.UploadFileAsync(pathToFile);

You can modify the number of parallel threads that the uploader will use through its options. You can also modify the size of each chunk - which defaults to 6MB.

var options = new AzureSasUploaderOptions 
{
    ParallelUploadThreads = 4, //Default: 4
    ChunkSizeInBytes = 1024 * 1024 * 6 //Default: 6MB
};

var uploader = new AzureSasUploader(mySasUrl, options);

About

A package containing an uploader for uploading to an Azure SAS Url.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages