This commit is contained in:
JORGE LUIS CAUDILLO ESPARZA
2019-09-04 16:28:31 -07:00
parent 0bb14f5138
commit 19d0e41453
12 changed files with 3228 additions and 135 deletions

32
SigAyuda.aspx.vb Normal file
View File

@@ -0,0 +1,32 @@

Partial Class Metronic_SigAyuda
Inherits System.Web.UI.Page
Protected Sub btnDownload_Click(sender As Object, e As EventArgs)
Try
Dim docto As String = TxtDocto.Text.Replace("/", "\")
Dim path As String = $"{AppDomain.CurrentDomain.BaseDirectory}{docto}"
Dim file As New System.IO.FileInfo(path)
Dim mimeType As String = "text/plain"
Try
mimeType = MimeMapping.GetMimeMapping(path)
Catch ex As Exception
End Try
'Response.Write(path)
Response.Clear()
Response.ClearHeaders()
Response.ClearContent()
Response.AddHeader("Content-Disposition", $"attachment; filename= {Uri.EscapeDataString(file.Name)}")
Response.AddHeader("Content-Length", file.Length.ToString())
Response.ContentType = mimeType
Response.Flush()
Response.TransmitFile(file.FullName)
Response.End()
Catch ex As Exception
'GuardaLog($"GenerateFile: {ex.ToString()}")
End Try
End Sub
End Class