Exemplo n.º 1
0
        private static void RunDownload(Configuration configuration)
        {
            var client = StorageClient.Create();

            Console.WriteLine("Downloading");
            using (var output = new NullStream())
            {
                using (var reporter = new ProgressReporter())
                {
                    client.DownloadObject(configuration.Bucket, configuration.ObjectName, output, progress: reporter);
                }
            }
            Console.WriteLine();
        }
Exemplo n.º 2
0
        private static void RunUpload(Configuration configuration)
        {
            var client = StorageClient.Create();

            Console.WriteLine("Uploading");
            using (var input = File.OpenRead(configuration.LocalFile))
            {
                using (var reporter = new ProgressReporter())
                {
                    client.UploadObject(configuration.Bucket, configuration.ObjectName, "application/binary", input, progress: reporter);
                }
            }
            Console.WriteLine();
        }