diff --git a/SigAyuda.aspx b/SigAyuda.aspx index 4b4f934bf..137278830 100644 --- a/SigAyuda.aspx +++ b/SigAyuda.aspx @@ -116,15 +116,15 @@ - - - + + + +

Manual del Rol

-
diff --git a/SigAyuda.aspx.vb b/SigAyuda.aspx.vb index 9a8704cdc..4a12070b3 100644 --- a/SigAyuda.aspx.vb +++ b/SigAyuda.aspx.vb @@ -28,7 +28,6 @@ Partial Class Metronic_SigAyuda If ObjRoles.DtResultados IsNot Nothing AndAlso ObjRoles.DtResultados.Rows.Count = 1 Then Me.Adjunto = ObjRoles.DtResultados.Rows(0)("Adjunto").ToString() If Not String.IsNullOrEmpty(Me.Adjunto) Then - linkDescargaRol.HRef = $"javascript:downFile('{Me.Adjunto}');" DivPerfil.Visible = True End If End If @@ -39,6 +38,26 @@ Partial Class Metronic_SigAyuda UpAdjunto.Update() End If End Sub + Private Sub DescargaArchivoDirecto(RutaArchivo As String) + If RutaArchivo <> "" Then + + 'Dim Path As String = String.Format("{0}\{1}", UsuarioActual.Empresa.Ruta, RutaArchivo) + Dim Archivo As New System.IO.FileInfo(RutaArchivo) + + If Archivo.Exists Then + HttpContext.Current.Response.Clear() + HttpContext.Current.Response.ClearContent() + HttpContext.Current.Response.ContentType = "application/octet-stream" + HttpContext.Current.Response.AppendHeader("Content-disposition", String.Format("attachment; filename={0}", Archivo.Name)) + HttpContext.Current.Response.AddHeader("Content-Length", Archivo.Length.ToString()) + HttpContext.Current.Response.TransmitFile(RutaArchivo) + 'HttpContext.Current.Response.Flush() + HttpContext.Current.Response.End() + End If + Archivo = Nothing + End If + End Sub + Protected Sub btnDownload_Click(sender As Object, e As EventArgs) Try Dim docto As String = TxtDocto.Text.Replace("/", "\") @@ -67,4 +86,8 @@ Partial Class Metronic_SigAyuda End Sub + + Protected Sub LnkDescargarManualRol_Click(sender As Object, e As EventArgs) + DescargaArchivoDirecto($"{UsuarioActual.Empresa.Ruta}Roles/{Me.Adjunto}") + End Sub End Class