Upload file save to the "File" folder but not getting file path correctly.
code file is (.aspx) store in another folder like "test". execute bellow code come to the file path "D:\ReadExcelToGrid\ReadExcelToGrid\test\Files\Talent Tree Event Request Form.xlsx". the correct file pathe is "D:\ReadExcelToGrid\ReadExcelToGrid\Files\Talent Tree Event Request Form.xlsx"
string FileName = Path.GetFileName(FileUpload1.PostedFile.FileName);
string FolderPath = ConfigurationManager.AppSettings["FolderPath"];// FolderPath is key in app setting in web config<appSettings>
<add key="FolderPath" value="Files/"/>
string FilePath = Server.MapPath(FolderPath + FileName);
How to solve plese help me.