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