Quote:System.UnauthorizedAccessException : Access to the path 'D:\Intranet\Portal\User\Pictures\6202.jpg' is denied.
var strPath1 = HttpContext.Current.Server.MapPath("~/User/Pictures/") + strFileName; var strPath2 = HttpContext.Current.Server.MapPath("~/Public/Pictures/") + strFileName; if (File.Exists(strPathName)) { HttpContext.Current.Application.Lock(); File.SetAttributes(strPathName, FileAttributes.Normal); File.Delete(strPathName); File.Delete(strPath1); File.Delete(strPath2); HttpContext.Current.Application.UnLock(); } oHttpPostedFile.SaveAs(strPathName); oHttpPostedFile.SaveAs(strPath1); oHttpPostedFile.SaveAs(strPath2);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)