Author: phamster | Posted on: 3/7/2010 12:36:08 PM | Views : 365

Hey guys, I was wondering does anyone know how to save a file to the sever without using a fileupload? What I have is a file that is dynamically created as a .CSV file. Here's that part of the code:
protected void exportToCSV(DataTable data, string fileName) { HttpContext context = HttpContext.Current; context.Response.Clear(); context.Response.ContentType = "text/csv"; context.Response.AddHeader("Content-Disposition", "attachment; filename=" + fileName + ".csv"); //rite column header names for (int i = 0; i < data.Columns.Count; i++) { if (i > 0) { context.Response.Write(","); } context.Response.Write(data.Columns[i].ColumnName); } context.Response.Write(Environment.NewLine); //Write data foreach (Data ...

Go to the complete details ...