Last post Aug 29, 2013 02:45 AM by ashokteli123
Aug 29, 2013 02:45 AM|ashokteli123|LINK
I have excel file on my server and I want to send it client side.
I have the follwing code
Response.Buffer = true; Response.ClearContent(); Response.ContentType = "application/ms-excel"; Response.AddHeader("Content-Disposition", @"attachment;filename=" + fileName); Response.Charset = ""; Response.TransmitFile(Server.MapPath(fileName));
HttpContext.Current.ApplicationInstance.CompleteRequest(); System.Runtime.InteropServices.Marshal.ReleaseComObject(excel); System.Runtime.InteropServices.Marshal.ReleaseComObject(workbook);
On client side I m receiving the file but it has Page contents and not the contents which i have saved in it.