【问题标题】:Not able to see saved files inside azure storage container无法在 azure 存储容器中看到保存的文件
【发布时间】:2014-02-14 08:07:57
【问题描述】:
string filePath = @"C:\test.pdf";
CloudBlockBlob blockBlob = container.GetBlockBlobReference("DxRecordForm");
FileStream localDirDxRecordForm = File.Create(filePath);
localDirDxRecordForm.Close();
dxCodeReport.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, filePath);

using (var fileStream = System.IO.File.OpenRead(filePath))
{
      blockBlob.UploadFromStream(fileStream);
}

我将水晶报告导出为 pdf 格式,然后将 pdf 保存在 azure 存储容器中。在上面的代码中,dxCodereport 是水晶报表的一个实例。当我查看我的存储容器时,我看到了名为 DxRecordForm 的块 blob。当我点击它时,我还可以看到我的水晶报告的 pdf 版本。 我不确定为什么在容器中看不到文件 Test.pdf。我只看到内容类型为 application/octet-stream 的块 blob。

【问题讨论】:

    标签: crystal-reports azure-storage azure-blob-storage


    【解决方案1】:

    上面的代码 sn-p 将文件 C:\test.pdf 上传到名为 DxRecordForm 的块 blob。这不会导致创建名为 test.pdf 的 blob。如果您想上传一个名为 test.pdf 的 blob,请在获取块 blob 引用时使用“test.pdf”。

    【讨论】:

      猜你喜欢
      • 2020-08-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-08-25
      • 1970-01-01
      • 2015-04-01
      • 1970-01-01
      • 2021-09-20
      相关资源
      最近更新 更多