尝试在服务器上创建文件夹时访问被拒绝
客户端注册系统的每个新项目都会创建一个文件夹来存储位于“\Images\Projects{ProjectID}”中的图像,其中{ProjectID}是项目ID。
我在文件夹“\Images\Projects\”中放入了一个 web.config 以允许登录用户访问。
<configuration>
<system.web>
<authorization>
<deny users="?" />
</authorization>
</system.web>
</configuration>
创建文件夹时出现错误:
访问路径 'e:\home\amsdarquit\Web\Images\Projects\166' 被拒绝。
166是项目代码和文件夹名称。 我检查了我的服务器,但没有创建相同的内容。
创建文件夹的代码
//Save Image
var serverPath = Server.MapPath(Href("~/Images/Projects/") + id);
Directory.CreateDirectory(serverPath);
imgOri.Save(Path.Combine(serverPath, fileName));
我在网站上查看过,但没有找到任何帮助我的东西。
Every new project that the client registers the system creates a folder to store the images located in "\Images\Projects{ProjectID}" where {ProjectID} is the ID project.
I put in the folder "\Images\Projects\" a web.config to allow access to users logged on.
<configuration>
<system.web>
<authorization>
<deny users="?" />
</authorization>
</system.web>
</configuration>
When creating the folder, the error is displayed:
Access to the path
'e:\home\amsdarquit\Web\Images\Projects\166'
is denied.
166 is the project code, and the folder name.
I checked on my server, and the same is not created.
Code to create the folder
//Save Image
var serverPath = Server.MapPath(Href("~/Images/Projects/") + id);
Directory.CreateDirectory(serverPath);
imgOri.Save(Path.Combine(serverPath, fileName));
I have looked on the site, but found nothing to help me.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
检查“NETWORK SERVICE”用户(或运行应用程序的用户)是否具有驱动器上父目录的修改权限。
Check whether 'NETWORK SERVICE' user (or the user that you run your application as) has modification rights for the parent directory on the drive.