Good luck getting any browser to open an .exe file... Warning Will Robinson... Warning...
Anyways, here's a snippet....
Response.Clear();
Response.ContentType = "application/octet-stream";
Response.AddHeader("Content-Disposition", "attachment; filename=" + downloadName);
while (dataToRead > 0)
{
if (Response.IsClientConnected)
{
fileLength = iStream.Read(buffer, 0, buffer.Length);
Response.OutputStream.Write(buffer, 0, fileLength);
Response.Flush();
dataToRead = dataToRead - fileLength;
}
else
{
dataToRead = -1;//prevent infinite loop if user disconnects
}
}
Edit: Ok, i suppose you could create the thank you page with a hidden button on it, inject some javascript to click that button upon load, which would then execute the code to dump the file into the response stream.