文件夹问题 [英] Folder issue

查看:61
本文介绍了文件夹问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个问题。我想在asp.net中由用户在我们的网站上创建一个文件夹。那么,任何人都可以帮我找到解决方案

i have an issue. i want to make a folder in our website by user in asp.net. so, can anyone help me to find out the solution

推荐答案

System.IO.Directory。 CreateDirectory 应该在asp中工作。 net ...条件是执行代码的帐户在ntfs文件系统上具有足够的权限,以在您选择的位置创建目录。请注意,
除非您使用< identity impersonate ...>,运行代码的帐户不是浏览Web应用程序的用户的帐户,而是IIS池的帐户您在发布时分配到您的网站。使
确保此类帐户被授予足够的权限。

System.IO.Directory.CreateDirectory should work in asp.net... on the condition that the account under which the code is executing has enough permissions on the ntfs file system to create the directory at your chosen location. Beware that, unless you are using <identity impersonate...>, the account under which the code runs is NOT the account of the user that is browsing the web application, but the account of the IIS Pool that you assigned to your web site when you published it. Make sure that such account is granted the adequate permissions.

如果用户输入了目录名,请确保清理输入以避免创建路径 - 遍历漏洞。

If the directory name is typed-in by the user, make sure that you sanitize the input to avoid creating a path-traversal vulnerability.


这篇关于文件夹问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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