Iis – How to stop users directly accessing files on a website in IIS

asp.netiisiis-7.5iis-8windows-server-2008

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.

Best Answer

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