Hai guys,
I have two folders called CSVLoad and Forms... I have an aspx page inside forms folder which has a fileupload control. I save my uploaded file to my CSVLoad folder i gave the following path
FileUpload1.SaveAs(Server.MapPath("CSVLoad//" + FileUpload1.FileName));
I am receiving file not found exception...
Could not find a part of the path
'F:\WebSites\Payroll\Forms\CSVLoad\Employeesdata.csv'
CSVLoad folder is outside Forms folder (ie) both are root level folders of my application
Answer :
FileUpload1.SaveAs(Server.MapPath("~/CSVLoad//" + FileUpload1.FileName));
from one of previous SO questions http://stackoverflow.com/questions/1158530/asp-net-server-mappath-problem-from-inner-folders