About disabling the directory list in web.config

I disabled the list of directories in the folder (named Documents) in my asp.net project with the web.config settings below.

It works, and http://mywebsite.com/Documents/ does not list files. But I want the user to open the file from this place. For example, this link http://mywebsite.com/Documents/file.pdf also gives an error.

Is it possible to open a file from a directory that does not allow directories. Thanks in advance.

<configuration> <system.webServer> <directoryBrowse enabled="false" /> </system.webServer> </configuration> 
+4
source share

All Articles