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
MickPosted Sep 26, 2005, 10:52 AM
Many thanks for this... It did the trick.
Mick
KOTHANDARAM VIJAYASARATHYPosted Sep 23, 2005, 1:08 PM
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
AllanPosted Sep 15, 2005, 7:49 PM
Add a Response.End() after the respone.flush()
Allan
www.rosterone.com