SalimAzureBlobAPI/SalimAzureAPI/AzureBlobManager.cs
/// <summary>
/// Updates or created a blob in Azure blob storage
/// </summary>
/// <param name="containerName">Name of the container to upload into.</param>
/// <param name="blobName">Name of the blob.</param>
/// <param name="content">The content of the blob.</param>
/// <returns></returns>
Updates or created a blob in Azure blob storage
Updates or created a blob in Azure blob storage
public bool PutBlob(string containerName, string blobName, byte[] content)
        {
            return ExecuteWithExceptionHandlingAndReturnValue(
                    () =>
                    {
                        CloudBlobContainer container = _blobClient.GetContainerReference(containerName);
                        _blockBlob = container.GetBlockBlobReference(blobName);
                        using (var stream = new MemoryStream(content, writable: false))
                        {
                            _blockBlob.UploadFromStream(stream);
                        }
                    });
        }
public bool PutBlob ( string containerName , string blobName , byte [ ] content ) { return ExecuteWithExceptionHandlingAndReturnValue ( ( ) => { CloudBlobContainer container = _blobClient . GetContainerReference ( containerName ) ; _blockBlob = container . GetBlockBlobReference ( blobName ) ; using ( var stream = new MemoryStream ( content , writable : false ) ) { _blockBlob . UploadFromStream ( stream ) ; } } ) ; }
Updates or created a blob in Azure blob storage
Updates or created a blob in Azure blob storage
//CloudBlob blob = container.GetBlobReference(blobName); //blob.UploadByteArray(content);
None
containerName
string
Name of the container to upload into.
Name of the container to upload into .
blobName
string
Name of the blob.
Name of the blob .
content
byte[]
The content of the blob.
The content of the blob .