Skip to content

Commit bcbced2

Browse files
authored
Merge pull request #9 from CamSoper/master
Reconciled multiple PRs that conflict with recent changes
2 parents 21dc2de + 2650b67 commit bcbced2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

WebApp-Storage-DotNet/Controllers/HomeController.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ namespace WebApp_Storage_DotNet.Controllers
2323
using Microsoft.WindowsAzure.Storage;
2424
using Microsoft.WindowsAzure.Storage.Blob;
2525
using Microsoft.Azure;
26+
using System.Configuration;
2627

2728
/// <summary>
2829
/// Azure Blob Storage Photo Gallery - Demonstrates how to use the Blob Storage service.
@@ -62,7 +63,7 @@ public async Task<ActionResult> Index()
6263
{
6364
// Retrieve storage account information from connection string
6465
// How to create a storage connection string - http://msdn.microsoft.com/en-us/library/azure/ee758697.aspx
65-
CloudStorageAccount storageAccount = CloudStorageAccount.Parse(CloudConfigurationManager.GetSetting("StorageConnectionString"));
66+
CloudStorageAccount storageAccount = CloudStorageAccount.Parse(ConfigurationManager.AppSettings["StorageConnectionString"].ToString());
6667

6768
// Create a blob client for interacting with the blob service.
6869
blobClient = storageAccount.CreateCloudBlobClient();
@@ -111,7 +112,7 @@ public async Task<ActionResult> UploadAsync()
111112
for (int i = 0; i < fileCount; i++)
112113
{
113114
CloudBlockBlob blob = blobContainer.GetBlockBlobReference(GetRandomBlobName(files[i].FileName));
114-
await blob.UploadFromFileAsync(files[i].FileName);
115+
await blob.UploadFromFileAsync(files[i].FileName, FileMode.Open);
115116
}
116117
}
117118
return RedirectToAction("Index");

0 commit comments

Comments
 (0)