创建ASP.NET和Azure的云存储应用 [英] Create a cloud storage app with ASP.NET and Azure

查看:199
本文介绍了创建ASP.NET和Azure的云存储应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用ASP.NET MVC,C#创建一个云存储应用程序,它与Azure存储整合。

我现在有一个功能界面,允许用户注册,并安全地存储在SQL数据库的详细信息。我使用的是使用的Azure创建BLOB存储<一个也有一个基本的文件上传href=\"http://www.c-sharpcorner.com/UploadFile/abhikumarvatsa/working-with-azure-blob-storage-in-mvc/\"相对=nofollow>本教程作为指导原则。

我的问题关于如何为用户提供自己的集装箱/页,因此他们的文件只能由他们的访问。目前,文件上传和Azure的容器被共享,所以任何人用一个账户可以查看和编辑上传。我想限制本使每个用户具有不能被读出或由他人修改他们自己的个人空间

我已经寻找答案,但无法找到任何适合我的需要。任何意见将大大AP preciated。


解决方案

  

我的问题关于如何为用户提供自己的集装箱/页,以便
  他们的文件只能由他们进行访问。


要实现这一点的一种方式是通过向用户分配一个容器。当用户注册作为注册过程的一部分,你为用户创建一个blob容器和储存容器的名字与有关用户的其它详细信息。当在用户登录,您获取仅该容器该信息,只显示文件。用户上传的文件同样,当你在保存只容器中的文件。

有几件事情你需要考虑:


  • 您不能设置在容器大小的硬限制。因此,一个容器可以是一样大的尺寸您的存储帐户。如果你想放多少数据的用户可以上传一些限制,你需要管理你的应用程序存储空间的外面。您可能还需要寻找到Azure的文件服务,如果这是一个要求。在Azure的文件服务,你可以限制一个共享的大小(一个blob容器当量)。

  • 您可能甚至想在多个存储帐户的负载平衡您的用户实现更好的吞吐量。如果您决定再这条路线下井带容器名称一起,你还需要存储帐户名称存储与用户的相关信息。

I need to create a cloud storage application using ASP.NET MVC, C# and integrate it with Azure storage.

I currently have a functional interface which allows users to register and securely stores their details in an SQL database. I also have a basic file uploader using Azure Blob storage that was created using this tutorial as a guideline.

My question regards how to give users their own container/page so that their files are only accessible by them. At the moment, the file uploader and Azure container is shared so that anybody with an account can view and edit the uploads. I want to restrict this so that each user has their own individual space that cannot be read or modified by others.

I have searched for answers but cannot find anything that suits my needs. Any advice would be greatly appreciated.

解决方案

My question regards how to give users their own container/page so that their files are only accessible by them.

One way to achieve this is by assigning a container to a user. When a user signs up, as a part of registration process you create a blob container for the user and store the name of the container along with other details about the user. When the user signs in, you fetch this information and only show files from that container only. Similarly when the user uploads the files, you save the files in that container only.

A few things you would need to consider:

  • You can't set any hard limit on the size of the container. So a container can be as big as a size of your storage account. If you want to put some restrictions on how much data a user can upload, you would need to manage that outside of storage in your application. You may also want to look into Azure File Service if that's a requirement. In Azure File Service, you can restrict the size of a share (equivalent of a blob container).
  • You may even want to load-balance your users across multiple storage accounts to achieve better throughput. If you decide to go down this route then along with container name, you would also need to store the storage account name along with user information.

这篇关于创建ASP.NET和Azure的云存储应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆