docx файлы и transmitfile
просто отдаю файл, сохраняю. потом пытаюсь его открыть и пишет файл порченный. хотя один в один совпадает с исходным.Подскажите, что я делаю не так.
вот коз из странички
Response.Clear();
Response.ClearContent();
Response.ClearHeaders();
Response.Buffer = true;
Response.ContentType = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
Response.AppendHeader("Content-Disposition", "attachment; filename=test222.docx");
string _doc2 = @"D:\ipc\Templates\empty2.docx";
Response.AddHeader("Content-Length", new System.IO.FileInfo(_doc2).Length.ToString());
Response.TransmitFile(_doc2);
Response.Flush();
Response.Close();
Response.End();
Пока на собственное сообщение не было ответов, его можно удалить.
Удалить