Hey all,
I am using a .ashx page to send an offline PDF file. The object behind the ashx file implements IHttpHandler. (sample code below) When running this page through a https url, I get a prompt asking if I want to display both the secure and nonsecure items. Is my PDF sent securely? How could I find out? If not, what would I need to do to send it securely?
Any help is much appreciated!
.ashx fike:
<%@ webhandler Language="vb" class="library.DownloadFileObj" %>
vb object:
Imports System
Imports System.Web
Imports System.IO
Imports System.Text
Imports System.Web.UI
Imports System.Web.SessionState
' Used to provide a secure way to return a file from windoze FS without giving IIS free reign over all data files.
Public Class DownloadFileObj
Implements IHttpHandler, IRequiresSessionState
Public ReadOnly Property IsReusable() As Boolean Implements System.Web.IHttpHandler.IsReusable
Get
Return True
End Get
End Property
Public Sub ProcessRequest(ByVal context As System.Web.HttpContext) Implements System.Web.IHttpHandler.ProcessRequest
If File.Exists(flpth) Then
context.Response.ContentType = "application/pdf"
context.Response.WriteFile(flpth)
Else
context.Response.Write("File Not Found")
End If
End If
End Sub
End Class
I am using a .ashx page to send an offline PDF file. The object behind the ashx file implements IHttpHandler. (sample code below) When running this page through a https url, I get a prompt asking if I want to display both the secure and nonsecure items. Is my PDF sent securely? How could I find out? If not, what would I need to do to send it securely?
Any help is much appreciated!
.ashx fike:
<%@ webhandler Language="vb" class="library.DownloadFileObj" %>
vb object:
Imports System
Imports System.Web
Imports System.IO
Imports System.Text
Imports System.Web.UI
Imports System.Web.SessionState
' Used to provide a secure way to return a file from windoze FS without giving IIS free reign over all data files.
Public Class DownloadFileObj
Implements IHttpHandler, IRequiresSessionState
Public ReadOnly Property IsReusable() As Boolean Implements System.Web.IHttpHandler.IsReusable
Get
Return True
End Get
End Property
Public Sub ProcessRequest(ByVal context As System.Web.HttpContext) Implements System.Web.IHttpHandler.ProcessRequest
If File.Exists(flpth) Then
context.Response.ContentType = "application/pdf"
context.Response.WriteFile(flpth)
Else
context.Response.Write("File Not Found")
End If
End If
End Sub
End Class