Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions WebApp-Storage-DotNet/Controllers/HomeController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ namespace WebApp_Storage_DotNet.Controllers
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Blob;
using Microsoft.Azure;
using System.Configuration;

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

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