ASP.NET MVC4中的用户特定文件访问 [英] User Specific File Access in ASP.NET MVC4

查看:143
本文介绍了ASP.NET MVC4中的用户特定文件访问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将其他登录用户上传的文件保存在内容"文件夹中.

I am saving files uploaded by different loggedin users in Content folder.

但是任何用户都可以使用xxx.com/content/file.doc访问此文件夹中的文件.

But any user can access the files from this folder using xxx.com/content/file.doc.

我希望登录的用户仅查看其文件,而不查看其他人上传的文件.

I want the loggedin user to view only his file not what others have uploaded.

关于如何实现此安全功能的任何建议?

Any suggestion on how to implement this security feature??

推荐答案

为每个用户创建一个单独的文件夹,并为这些用户设置安全性和所有者文件夹发送给用户.禁用对这些文件夹上的所有人"组的读取访问权限(因此,只有所有者和管理员/系统具有访问权限).
Create a separate folder for each user, and set security and owner on those folders to the user. Disable Read access to the group Everyone on those folders (so only the Owner and Administrators/System  will have access).


这篇关于ASP.NET MVC4中的用户特定文件访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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