Verifique se o docx está corrompido ou não
Eu tentei muitas soluções, mas o código está sempre verificando arquivo corrompido e envia true
using (FileStream fileStream = File.OpenRead(path[0]))
{
MemoryStream memStream = new MemoryStream();
memStream.SetLength(fileStream.Length);
fileStream.Read(memStream.GetBuffer(), 0, (int)fileStream.Length);
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.ContentType = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment; filename=myfile.docx");
HttpContext.Current.Response.BinaryWrite(memStream.ToArray());
HttpContext.Current.Response.Flush();
// HttpContext.Current.Response.Close();
HttpContext.Current.Response.End();
}
onde path [0] é a minha localização docx .. ainda lê o arquivo corrompido e não gera nenhum erro .. qualquer sugestão plz ..