How to upload file to the shared network folder using C# in ASP.Net

Last Reply one year ago By AnandM

Posted one year ago

 

 pathAndFile ="file://172.27.16.20/import/";

or

pathAndFile = "\\\\dmspams\\import\\";

pathAndFile += drpborrower.SelectedItem.ToString() + "_" + drpbank.SelectedItem.ToString() + "_" + drpdoctype.SelectedItem.ToString() + "_" + drpfy.SelectedItem.ToString() + "_" + drpmonth.SelectedItem.ToString() + "_" + txtdate.Text + ext;
//FileUpload1.SaveAs(pathAndFile);
if (System.IO.File.Exists(pathAndFile))
{
Page.RegisterStartupScript("OnClick", "<script>alert('This File Name is Already Available!')</script>");
}
else
{
fi.MoveTo(pathAndFile);

}

 

another