I have created excel file from asp.net table and am now able to download it.
Now I want to save this excel file on the server to be able to use it. I have tried to use string-writer to save the file folder, without succeeding. Here is my code which I have have written to generate file from asp.net.
tbl_loctbl.Controls.Clear();
LoadDetails();
Response.Clear();
Response.AddHeader("content-disposition", "attachment;filename=ProfessorWise.xls");
Response.ContentType = "application/ms-excel";
System.IO.StringWriter sw = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter hw = new HtmlTextWriter(sw);
tbl_loctbl.RenderControl(hw);
Response.Write(sw.ToString());
Response.End();
From this code, file is generated and downloaded to user pc.Loaddetails()
is function where I load data to asp.net table and then excel file generated.
How can I save it to server?