Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASHX and HTTPS

Status
Not open for further replies.

ryebread

Programmer
Aug 13, 2001
29
US
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



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top