Torna al Thread
Imports System.Web
Imports System.Web.Services
Public Class Download
Implements System.Web.IHttpHandler
Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
If IO.File.Exists(My.Settings.FilePathLog) Then
Dim fiFileLog As New IO.FileInfo(#PATHFILE#)
context.Response.ContentType = "application/octet-stream"
context.Response.AddHeader("Content-disposition", String.Format("attachment; filename={0}", fiFileLog.Name))
context.Response.WriteFile(#PATHFILE#, False)
Else
context.Response.Write("File non trovato o inesistente.")
End If
End Sub
ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable
Get
Return True
End Get
End Property
End Class