From 3cd5b6d57d8fed5c73174ca31a9381d9be606749 Mon Sep 17 00:00:00 2001 From: Antonio Gonzalez Date: Thu, 2 Jul 2020 09:24:13 -0700 Subject: [PATCH] . --- Sistemas/Empresa.aspx.vb | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/Sistemas/Empresa.aspx.vb b/Sistemas/Empresa.aspx.vb index 6190efd84..456ba4757 100644 --- a/Sistemas/Empresa.aspx.vb +++ b/Sistemas/Empresa.aspx.vb @@ -1684,11 +1684,22 @@ Partial Class Sistemas_Empresa 'Dim fi As New FileInfo(File) Dim byteArray As Byte() = File.ReadAllBytes(FilePath) + 'HttpContext.Current.Response.Clear() + 'HttpContext.Current.Response.ClearContent() + 'HttpContext.Current.Response.ContentType = "application/octet-stream" + 'HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment filename=prueba.docx") + 'HttpContext.Current.Response.AddHeader("Content-Length", byteArray.Length.ToString()) + 'HttpContext.Current.Response.OutputStream.Write(byteArray, 0, byteArray.Length) + 'HttpContext.Current.Response.End() + Response.Buffer = True Response.Clear() Response.ContentType = "application/octet-stream" - Response.AddHeader("Content-Disposition", "attachment filename=prueba.docx") - Response.OutputStream.Write(byteArray, 0, byteArray.Length) - Response.Flush() + HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment filename=prueba.docx") + HttpContext.Current.Response.BinaryWrite(byteArray) ' create the file + HttpContext.Current.Response.Flush() ' send it to the client to download + HttpContext.Current.Response.SuppressContent = True + HttpContext.Current.ApplicationInstance.CompleteRequest() + HttpContext.Current.Response.End() End Sub End Class