Exemple #1
0
        public static void UploadFile(this IBlobStorageClient blobStorageClient, string filePath, string blobName)
        {
            blobStorageClient.Require("blobStorageClient");
            filePath.Require("filePath");
            blobName.Require("blobName");

            blobStorageClient.UploadBlob(new MemoryStream(File.ReadAllBytes(filePath)), blobName);
        }
Exemple #2
0
        public static void UploadText(this IBlobStorageClient blobStorageClient, string text, string blobName)
        {
            blobStorageClient.Require("blobStorageClient");
            text.Require("text");
            blobName.Require("blobName");

            blobStorageClient.UploadBlob(new MemoryStream(Encoding.UTF8.GetBytes(text)), blobName);
        }
Exemple #3
0
        public static void UploadBytes(this IBlobStorageClient blobStorageClient, byte[] bytes, string blobName)
        {
            blobStorageClient.Require("blobStorageClient");
            bytes.Require("bytes");
            blobName.Require("blobName");

            if (bytes.Length == 0)
            {
                throw new ArgumentException("Byte array is empty.", "bytes");
            }

            blobStorageClient.UploadBlob(new MemoryStream(bytes), blobName);
        }