I have a word document in my server, that I want to send to my client. Actually I want them to download that file. I am creating that file in runtime, and I want to delete it after they download it from my server. I'm trying this scenario locally. After the creation of file, my server sends it to client. In web browser I see this:
I don't want this. I want web browser to open save file dialog. I want client to download real file. Here is my code :
Guid temp = Guid.NewGuid();
string resultFilePath = Server.MapPath("~/formats/sonuc_" + temp.ToString() + ".doc");
if (CreateWordDocument(formatPath, resultFilePath , theLst)) {
Response.TransmitFile(resultFilePath);
Response.Flush();
System.IO.File.Delete(resultFilePath);
Response.End();
}