I am working on a site for a client that has a members area and I need a way to stop specific files from been downloaded by any one.
I have been trying to use a controller to hijack http requesteds but it dose not seem to be working.
Is there a way using IHttpHandler to intercept http reqest on download. I started to look at this but I am using the latest version of version 8 and it dose not seem to be hitting my custome media control. Even though I have registed the control using:
composition.Register
I just need to intercept the http request and check the file if it restricted or not. I know I can check using the media service to get the file propertys so that not a problem, the Issue I am having is I can't intercept any HTTP requests.
HTTP Request Intercept
Hi,
I am working on a site for a client that has a members area and I need a way to stop specific files from been downloaded by any one.
I have been trying to use a controller to hijack http requesteds but it dose not seem to be working.
Is there a way using IHttpHandler to intercept http reqest on download. I started to look at this but I am using the latest version of version 8 and it dose not seem to be hitting my custome media control. Even though I have registed the control using:
composition.Register
I just need to intercept the http request and check the file if it restricted or not. I know I can check using the media service to get the file propertys so that not a problem, the Issue I am having is I can't intercept any HTTP requests.
you will need to write an IHttpHandler
I have tried that but it not working, do I need to register it or should it just work out of the box??
I can't find any thing in the documentation on how to register a IHttpHandler
I'm away from my pc currently but will check what I did in the morning
IIRC you register it in web.config
You'll need to look over Microsoft documentation:
https://learn.microsoft.com/en-us/troubleshoot/developer/webapps/aspnet/development/http-modules-handlers#http-handlers-overview
I had to change the web.config that is in the media folder, not the websites web.config
My media folder web.config is like below
is working on a reply...