I have tried to upload the files in to my azure blob using below code
public async void UploadSync(IEnumerable<IFormFile> files, string path)
{
string MyPath = path.Replace("https://browsercontent.blob.core.windows.net/blob1/", "");
try
{
foreach (var file in files)
{
var newBlob = container.GetBlockBlobReference(MyPath);
await newBlob.UploadFromFileAsync(@"C:\Users\joy\Downloads\" + file.FileName);
}
}
catch (Exception ex)
{ throw ex;}
}
Actually i have upload the jpg file but it upload in a "application/octact steam" type. how to resolve it?
And my scenario is while uploading the file, windows explorer will open to select the file to upload. So if we provide the path as static as below,
newBlob.UploadFromFileAsync(@"C:\Users\joy\Downloads\" + file.FileName);
it will not be applicable for application. How to change this code to upload the files from various locations?