I am trying to download a file from a Windows 2000 server using the following code:
string fileName = System.IO.Path.GetFileName(strFilePath);
Response.ClearHeaders();
Response.ClearContent();
Response.Clear();
Response.ContentType = "text/HTML";
Response.AddHeader("Content-Disposition", "attachment; filename=" + fileName);
// Make sure the client is still connected.
if (Response.IsClientConnected)
{
Response.TransmitFile(strFilePath);
Response.Flush();
}
However, along with the file data, the HTML from the ASP page is also downloaded!
I have also tried code using "Response.Output.Write(bBuffer, 0, nBytesRead);"
If anyone has an idea about why the HTML is being appended, and how to stop it, I would be grateful!
Thanks
Mick

Allan2 reputationPosted Sep 15, 2005, 3:49 PM EDT
Add a Response.End() after the respone.flush()
Allan
www.rosterone.com
KOTHANDARAM VIJAYASARATHY2 reputationPosted Sep 23, 2005, 9:08 AM EDT
I have to EMBED AN cHTML File inside an ASP container control like Panel control. The web page contained inside the control must look and behave like it normally does individually. Is there any specific method to do it.
Thanks and regards,
Ram
Mick3 reputationPosted Sep 26, 2005, 6:52 AM EDT
Many thanks for this... It did the trick.
Mick