Hi @TestDeveloper12345 ,
Here is a C# method to list all files in a blob container:
public async Task ListAsync()
{
// Get a connection string to our Azure Storage account.
string connectionString = ConnectionString;
// Get a reference to a container named "sample-container" and then create it
BlobContainerClient container = new BlobContainerClient(connectionString, Randomize("sample-container"));
await container.CreateAsync();
try
{
// List all the blobs
List<string> names = new List<string>();
await foreach (BlobItem blob in container.GetBlobsAsync())
{
names.Add(blob.Name);
}
}
catch(Exception ex)
{
// Log the exception
}
}
If you know the path of the file you want to download, then you can make use of the following method:
public async Task DownloadImageAsync(string downloadPath)
{
// Download the public blob at https://aka.ms/bloburl
await new BlobClient(new Uri("https://yourbloburl")).DownloadToAsync(downloadPath);
byte[] fileBinary = File.ReadAllBytes(downloadPath)//you have the binary of the file so you can decide what to do with the file.
}