web.config 中特定文件夹的写入权限

发布于 2024-12-25 03:22:15 字数 252 浏览 2 评论 0原文

我的问题很简单。有没有办法授予当前用户(IIS 用户,在本例中为 ASP NET 用户)使用 web.config 写入特定文件夹位置(Web 应用程序内的文件夹)的权限?因为,每次我们想要在网站上进行文件上传时,要求网络托管服务商获得对特定文件夹的访问权限会变得很无聊。

我知道使用 google 找到答案可能非常简单,但它不断返回我如何写入 INTO web.config,而不是写入特定文件夹的 web.config 的权限。另外,我是法国人,所以我的英语不是最好的。

My question is preaty simple. Is there any way to give current user (IIS User, in this case, ASP NET USER) permission to write to a specific folder location (folder inside our web application) using web.config? Because, it's getting boring to ask to the web hoster to gain access to a specific folder each time we want to do a file uploader on a website.

I know it's maybe preaty simple to find an answer using google, but it keeps returning me how to write INTO web.config instead of permission to write into web.config FOR a specific folder. In addition, I'm french so my english is not at the top.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

猫九 2025-01-01 03:22:15

不。如果可能的话,您可以编写一个应用程序,当部署在服务器上时,该应用程序将允许您写入磁盘上的任何目录,尽管管理员拒绝写入访问。

No. If that was possible, you could write an application which, when deployed on a server, would allow you to write to any directory on the disk despite write access being denied by the administrator.

倾城°AllureLove 2025-01-01 03:22:15

您可以轻松地为本地用户(例如运行 IIS 工作进程/应用程序池的用户)授予对文件系统上任何位置的文件夹的权限,实际上是通过 Windows 本身的权限,但这不允许通过 Web 执行此操作.config 文件本身。请向我们描述您具体想要做什么,可能会有更好的解决方案。我上面提到的解决方案可能存在一点安全风险,但这取决于需求和情况。

You can easily grant permissions for a local user (e.g. the user that the IIS worker process/app pool is running as) to a folder anywhere on your filesystem actually through rights permissions in Windows itself but this does not allow for doing this through the web.config file itself. Please give us a description of what you're trying to do specifically and there may be a better solution. The solution I mentioned above could be a bit of a security risk but it depends on the needs and situation.

ぃ双果 2025-01-01 03:22:15

因此,据我了解,.NET(和 web.config)并没有真正控制写入权限。

您需要从文件系统和/或网络服务器级别公开该文件夹以允许人们访问(尽管这可能是一个安全问题,具体取决于您的情况)。或者另一种可能性是创建一个简单的网页,允许将文件上传到目录。

So, from what I understand .NET (and web.config) don't really control write permissions.

You'll need to either expose the folder from a filesystem and/or webserver level to allow people access (though this may be somewhat of a security issue depending on your scenario). Or another possibility would be to create a simple web-page that allows uploading files to the directory.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文