hi all,
i want to block the users from accessing certain extenstions like .swf in my site (not using IIS).
i want to know the best way to carry this out. currently i tries using HttpHandlers. it doesnt work.
My code:
Config code
<httpHandlers>
<add verb="*" path="*.swf" type="SwfHandler,SwfHandler" />
</httpHandlers>
My SWF handler code:
Imports System
Imports System.Configuration
Imports System.Web
Public Class SwfHandler
Implements IHttpHandler
Public Sub ProcessRequest(ByVal context As System.Web.HttpContext) Implements System.Web.IHttpHandler.ProcessRequest
Dim request As HttpRequest = context.Request
Dim response As HttpResponse = context.Response
response.redirect(" End Sub
Public ReadOnly Property IsReusable() As Boolean Implements System.Web.IHttpHandler.IsReusable
Get
Return False
End Get
End Property
End Class
some doubts:
I created a HttpModule prior to this. When i tried to use it in a sub folder's config file the <httpModule> tag didnt work. When i put it in the root folder's config file tag it worked. Am i doing anyting wrong???
Known is handfull, Unknown is worldfull
i want to block the users from accessing certain extenstions like .swf in my site (not using IIS).
i want to know the best way to carry this out. currently i tries using HttpHandlers. it doesnt work.
My code:
Config code
<httpHandlers>
<add verb="*" path="*.swf" type="SwfHandler,SwfHandler" />
</httpHandlers>
My SWF handler code:
Imports System
Imports System.Configuration
Imports System.Web
Public Class SwfHandler
Implements IHttpHandler
Public Sub ProcessRequest(ByVal context As System.Web.HttpContext) Implements System.Web.IHttpHandler.ProcessRequest
Dim request As HttpRequest = context.Request
Dim response As HttpResponse = context.Response
response.redirect(" End Sub
Public ReadOnly Property IsReusable() As Boolean Implements System.Web.IHttpHandler.IsReusable
Get
Return False
End Get
End Property
End Class
some doubts:
I created a HttpModule prior to this. When i tried to use it in a sub folder's config file the <httpModule> tag didnt work. When i put it in the root folder's config file tag it worked. Am i doing anyting wrong???
Known is handfull, Unknown is worldfull