我在 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/