我正在尝试将图像文件保存在我的 WebApplication 文件夹中,但它不起作用这是目录映射
wwwroot
-
-
-----RegApp
- -
- ----Images
-
-
-----RegService
我正在将文件保存WebService(RegService)
到WebApp(RegApp)
目录中这是来自 WebService 的代码
File.WriteAllBytes(Server.MapPath("../RegApp//Images//" + Email + ".jpeg"), Convert.FromBase64String(PictureByteString));
但它给了我这个
System.Web.HttpException: Cannot use a leading .. to exit above the top directory.
at System.Web.Util.UrlPath.ReduceVirtualPath(String path)
at System.Web.Util.UrlPath.Reduce(String path)
at System.Web.Util.UrlPath.Combine(String appPath, String basepath, String relative)
at System.Web.VirtualPath.Combine(VirtualPath relativePath)
at System.Web.HttpRequest.MapPath(VirtualPath virtualPath, VirtualPath baseVirtualDir, Boolean allowCrossAppMapping)
at System.Web.HttpRequest.MapPath(VirtualPath virtualPath)
at System.Web.HttpServerUtility.MapPath(String path)