Saving Uploaded files in a directory

Sandhyab
Posted by Sandhyab under ASP.NET category on | Points: 40 | Views : 777
     string physicalPath = System.Configuration.ConfigurationManager.AppSettings["PhisicalDirectory"].ToString();
DateTime date = DateTime.Now;
Month = date.Month.ToString();
Year = date.Year.ToString();
day = DateTime.Now.Day.ToString();
string fileName = FileUploadAttach.PostedFile.FileName + DateTime.Now.ToString("yyyyddMMHHmmss");
string savepath = physicalPath + Year + "/" + Month + "/" + day + "/" + fileName;
FileUpload1.SaveAs(savepath);

Comments or Responses

Login to post response