1

I want to stop users on the internet being able to enter this URL into a browser and access these files directly. How can I do this?

for example: mysite/uploadedfiles/file1.txt

is there any iis rule? Please help me.

Rakesh
  • 115
  • 3

2 Answers2

1

If your txt files are not meant to be directly delivered to the users via HTTP and they are just accessed by your application logic, you should move them to a different location, not directly published by IIS. This could need some reengineering work. A temporary workaround could be setting up some kind of filtering based on HTTP-REFERRER.

Check this: https://blogs.msdn.microsoft.com/webdevelopertips/2008/12/15/tip-34-did-you-know-how-to-stop-hot-linking-from-your-site-using-url-rewrite-in-iis-7-0/

Px2016
  • 109
  • 4
0

This question is ambiguous, but a simple way would be to:

  1. Go to content view of the site, right click the file, click edit permissions, click on security tab and edit the permissions to remove IIS_IUSRS
JStellato
  • 136
  • 1
  • 5