I have an ASP.Net MVC
application run on IIS
. Is it possible to let the client to directly access certain file in the folder without going through normal (Controller-Action-View
) process?
Say, I have the domain name: www.example.com
and the file path is ~/.Sample/SubFolder/Filename
(note the dot '.'
before Sample
) relative to www.example.com
Now, without the dot '.'
, you can create a Controller
named Sample
and an Action
named SubFolder
which takes argument Filename
and returns the SubFolder View
in the Views
folder. But this folder is having a dot.
So, I want the application to directly show the Filename
content by writing
www.example.com/.Sample/SubFolder/Filename
When I already put the file Filename
in the .Sample/SubFolder
folder relative to www.example.com
and tried accessing it by writing www.example.com/Sample/Filename
, the following error is shown:
Server Error
404 - File or directory not found.
The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.
Any idea? A solution using IIS
is acceptable.