I am using ASP.NET 4.0 Framework.I have a directory which contains 10 PDF files i.e pdf1,pdf2….pdf10. On button click i am using Response.Redirect & passing Pdf file path in order to open it in the browser. but, this enables user to view the path(url) of the PDF folder using this url he can open any other pdf directly. How can i stop him accessing PDF directly from the url
Share
Use
Request.ServerVariables["HTTP_REFERER"]this will tell you where the request had come from. If its not on your site then take appropriate action.e.g.