diff --git a/WebApp-Storage-DotNet/Controllers/HomeController.cs b/WebApp-Storage-DotNet/Controllers/HomeController.cs index 9dd9ec5..586cc57 100644 --- a/WebApp-Storage-DotNet/Controllers/HomeController.cs +++ b/WebApp-Storage-DotNet/Controllers/HomeController.cs @@ -112,7 +112,8 @@ public async Task UploadAsync() for (int i = 0; i < fileCount; i++) { CloudBlockBlob blob = blobContainer.GetBlockBlobReference(GetRandomBlobName(files[i].FileName)); - await blob.UploadFromFileAsync(files[i].FileName, FileMode.Open); + blob.Properties.ContentType = files[i].ContentType; + await blob.UploadFromStreamAsync(files[i].InputStream); } } return RedirectToAction("Index");