There are some reference about File Uploading to Azure BY ASP.NET MVC but I can't find none in field of ASP.NET Webpages
How to implement such code to upload to Azure Storage?
Well.. For more information,
My goal is image uploading in CK Editor
but Due to Azure Hosting, ordinary CKEditor reference is not working.
So I googled and use this code block
CloudStorageAccount storageAccount = CloudStorageAccount.Parse(
CloudConfigurationManager.GetSetting("StorageConnectionString"));
// Create the blob client.
CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();
// Retrieve reference to a previously created container.
CloudBlobContainer container = blobClient.GetContainerReference("lawimage");
// Retrieve reference to a blob named "myblob".
CloudBlockBlob blockBlob = container.GetBlockBlobReference("myblob");
// Create or overwrite the "myblob" blob with contents from a local file.
using (var fileStream = System.IO.File.OpenRead(name))
{
blockBlob.UploadFromStream(fileStream);
}
But it doesn't work,
and my 'web.config' is
<appSettings>
<add key="StorageConnectionString" value="DefaultEndpointsProtocol=https;AccountName=lawcbt;AccountKey=[MyAccountKey]/>
</appSettings>
Is anyone ever did upload to Azure Storage via ASP.NET WebPages?
P.S> To be more clear, My 'upload.aspx' source file is this