I have functionality where i am reading, and displaying the record in a gridview after the uploading of excel file.
Now what I want to do is, I want to save that Excel file on the webserver with some Folder name, Here is my code below of displaying.
Please suggest how can I do this
protected void btnSave_Click(object sender, EventArgs e)
{
DataTable dtExcel = new DataTable();
dtExcel.Clear();
string StrCount = String.Empty;
string connString = "";
HttpPostedFile File = FileUpload1.PostedFile;
string strFileType = Path.GetExtension(FileUpload1.FileName).ToLower();
string path = FileUpload1.PostedFile.FileName;
string Filename = path.Substring(path.LastIndexOf("\\") + 1, path.Length - path.LastIndexOf("\\") - 1);
path = Server.MapPath(@"~/Excels/" + "/" + Filename.ToString());
...
Go to the complete details ...