[ad_1]
I want to transfer my local folder to azure blob for that I have used this movement nuget from azure docs website link
code from section – Transfer a local directory to Blob storage works
perfectly fine and upload all folder to blob but problem is all file
content-type is application/octet it should take its own default
content type like if its html it should uplaod html file content as
text/html
What should be done? pls guide.
public static async Task TransferLocalDirectoryToAzureBlobDirectory(CloudStorageAccount account)
{
string localDirectoryPath = GetSourcePath();
CloudBlobDirectory blobDirectory = GetBlobDirectory(account);
TransferCheckpoint checkpoint = null;
DirectoryTransferContext context = GetDirectoryTransferContext(checkpoint);
CancellationTokenSource cancellationSource = new CancellationTokenSource();
Console.WriteLine("\nTransfer started...\nPress 'c' to temporarily cancel your transfer...\n");
Stopwatch stopWatch = Stopwatch.StartNew();
Task task;
ConsoleKeyInfo keyinfo;
UploadDirectoryOptions options = new UploadDirectoryOptions()
{
Recursive = true
};
try
{
task = TransferManager.UploadDirectoryAsync(localDirectoryPath, blobDirectory, options, context, cancellationSource.Token);
[ad_2]