asp.net - Azure DocumentDB 和 Azure Blob 存储

标签 asp.net asp.net-mvc azure azure-cosmosdb azure-blob-storage

我在 ASP.net MVC 应用程序中使用 azure 文档数据库。目前我有 2 个集合,即员工和任务。目前,文档数据库操作一切正常。

但是我找不到上传多张图片的方法(不是一次上传多张图片) 针对一份文件。 例如:假设我需要针对单个员工文档存储 2 张员工照片。

我已经阅读了有关 azure blob 存储的信息,并认为我可以将其用于文件上传。但我无法澄清的是如何在每个员工文档中保留上传文件的引用.

有什么办法可以做到这一点吗?

最佳答案

I've read about the azure blob storage and think I can use it for the file uploads.But the thing that I can unable to clarify is how to keep the references of the uploaded files in each employee documents.

Blob 存储中的每个 Blob 都可以通过 URL 访问。您可以做的就是将这些 URL 与文档一起保存。例如,您的 Employee JSON 可能如下所示:

Employee = {
  'Id': '0001',
  'Name': 'Some Name',
  'Pictures': [
    'https://account.blob.core.windows.net/container/image1.png',
    'https://account.blob.core.windows.net/container/image2.png'
  ]
}

您可以做的其他事情是查看 Attachments在 DocumentDB 中。

关于asp.net - Azure DocumentDB 和 Azure Blob 存储,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35769127/

相关文章:

c# - 如何比较Azure资源配置

asp.net - Azure API应用程序与移动应用程序与Web应用程序

javascript - Azure 上使用 Node.js 的 Websocket 服务器

asp.net-mvc - EF 核心和 Azure

c# - 如何以编程方式阅读 SharePoint 列表?

javascript - 如何从 vb 代码立即调用 javascript 函数

c# - Entity Framework 插入空记录

asp.net - 无需在系统上安装 MySQL ODBC 5.1 驱动程序即可运行 .net 网站

mysql - 已经有一个与此连接关联的打开的 DataReader,必须先关闭它 + asp.net mvc

c# - MVC - Controller - 进行简单的数学计算 - 变量 + 1