客户注册系统的每个新项目都会创建一个文件夹来存储位于“\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));
我查看了该网站,但没有发现任何可以帮助我的东西。