大约有文件上传到Azure的BY ASP.NET MVC一些参考,但我无法找到没有在ASP.NET网页的领域文件上传到Azure存储由ASP.NET网页
如何实现这样的代码上传到Azure存储?
嗯..欲了解更多信息,
我的目标是在CK编辑器
但由于Azure的托管图片上传,普通CKEditor的参考不工作。
所以我用Google搜索,并使用此代码块
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);
}
但它不工作,
和我 '的web.config' 是
<appSettings>
<add key="StorageConnectionString" value="DefaultEndpointsProtocol=https;AccountName=lawcbt;AccountKey=[MyAccountKey]/>
</appSettings>
有没有人做过上传Azure存储通过ASP.NET WebPages?
P.S>更清楚,我的“upload.aspx”源文件是这样的
您是否获得某种处理错误的?或者,对服务器的POST请求返回OK(200),但该文件不在容器上? –
处理错误,我想要一些整体上传到Azure源的鸡尾酒由Asp.net网页 –