i have a code like this...
UPOBJ.U_TaskName = ddlTask.SelectedItem.Text.ToString();
UPOBJ.U_FileUploadPath = Server.MapPath("~/DaywiseReports");
string path = UPOBJ.U_FileUploadPath;
UPOBJ.U_Date=MetaData.StripTagsRegex(System.DateTime.Now.ToString("MMMM dd, yyyy"));
DirectoryInfo dirInfo = new DirectoryInfo(UPOBJ.U_FileUploadPath);
string reportFile = UploadReport.FileName;
string FileExtension = Path.GetExtension(reportFile);
UPOBJ.U_DayWiseReport = UPOBJ.U_Date + FileExtension;
if (UPOBJ.U_DayWiseReport != "" || UPOBJ.U_DayWiseReport != string.Empty)
{
dirInfo.CreateSubdirectory(UPOBJ.U_UserID.ToString());
UploadReport.SaveAs(path + "/" + UPOBJ.U_UserID.ToString() + "/" + UPOBJ.U_DayWiseReport.ToString() );
}
result = UBLOBJ.SubmitDaywiseReport(UPOBJ);
if (result > 0)
{
AlertMessage("Report Sent Succeesfully");
ddlTask.ClearSelection();
}
else
AlertMessage("Some Problem Occured While Sending the Report");
this code is successfully creating a directory daywisereports/username/reprtname with date..
but my problem is the file will be saved like this
daywisereports/username/taskname/reports..
for every task a subdirectory will be created like this..and if the daywise reports directory not presented automatically the directory will be cretaed..plz help me in witing this code
Regards,
Bhanu Prakash Bysani