about 5 years ago
Now in the current scenario, Most of the Project Owners want to keep their data on cloud. Specially for the .Net projects, we often need to store data in Cloud based Microsoft Azure server.
Azure provides azure storage account to facilitate the storing of files and images in Azure Blobs.
In Azure, we have three important things for storing files.
Container is contained within a storage account and Blobs are contained within the Container.
In order to retrieve files from Azure container we must have these 4 information:
Once we have all above information, we can store and retrieve files on/from azure
For private containers we need to authenticate through user credentials while for public containers, files can be accessed through the url.
Below mentioned is the code to retrieve a file from Azure Blob.
public byte GetUserFile(string filePath)
byte byteArray = null;
StorageCredentialsAccountAndKey creds = new StorageCredentialsAccountAndKey(accountName, key);
CloudBlobClient blobStorage = new CloudBlobClient(baseUri, creds);
CloudBlobContainer container = blobStorage.GetContainerReference(containerAddress);
CloudBlob Blob = container.GetBlobReference(filePath);
BlobStream blobStream = null;
blobStream = Blob.OpenRead();
byteArray = new byte[blobStream.Length];
blobStream.Read(byteArray, 0, byteArray.Count());
In the above written function, We are trying to retrieve byte array from Azure blob using the blobName(File Name).
This function returns the byte array of the blob where byte array is stored.
Starting with Chrome version 45, NPAPI is no longer supported for Google Chrome. For more information, see Chrome and NPAPI (blog.chromium.org).
Firefox and Microsoft Internet Explorer are recommended browsers for websites using java applets.
Chrome Version Support
Are you sure, you want to delete this comment?
Terms of Service
| © copyright 2020 FindNerd.com. All rights reserved.
Sign up using