我正在创建一个网站,可用于将文件上传到云端并下载相同的文件。当我在本地运行时尝试下载文件时,一切正常。将文件发布到 Azure 后,状态显示文件已下载,但文件在下载位置不可用。提前致谢
//My Download Code
` protected void OnDownloadImage(object sender, CommandEventArgs e)
{
var account = CloudStorageAccount.FromConfigurationSetting("DataConnectionString");
var client = account.CreateCloudBlobClient();
CloudBlobContainer blobContainer = client.GetContainerReference("Gallery");
var blobUri = (string)e.CommandArgument;
var srcBlob = this.GetContainer().GetBlobReference(blobUri);
srcBlob.FetchAttributes(new BlobRequestOptions { BlobListingDetails = BlobListingDetails.Metadata });
var path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory));
path = path + @"\AJStorage";
Directory.CreateDirectory(path);
path = path + "\\" + Path.GetFileName(srcBlob.Metadata["FileName"]);
srcBlob.DownloadToFile(path);
this.status.Text = "File Download Successful. File Location : " + path;
}`