public static void ParallelUpload(this CloudBlockBlob blobRef, string filename, BlobRequestOptions options)
{
if (null == options)
{
options = new BlobRequestOptions()
{
ServerTimeout = blobRef.ServiceClient.ServerTimeout,
//RetryPolicy = new ExponentialRetry(Microsoft.WindowsAzure.Storage.RetryPolicies..DefaultClientBackoff, RetryPolicies.DefaultClientRetryCount)
};
}
// get upload history if any
UploadInfo uploadInfo = UploadInfo.LoadByUploadFilename(filename);
using (FileStream fs = new FileStream(filename, FileMode.Open, FileAccess.Read))
{
blobRef.ParallelUpload(fs, uploadInfo, options);
}
// upload completed no history needed - delete it
if (File.Exists(uploadInfo.LogFilename))
File.Delete(uploadInfo.LogFilename);
Console.WriteLine("\nUpload completed.");
}