3
I have an application in mvc3 (Asp.net 4.0, dotnet 4.0), running at iis8 (but also running at iis 7 and iis 7.5).
Inside the application I have a folder called /dados
,
example localhost/minhaapp/dados
.
My clients save HTML files inside this folder, and these HTML files are accessed by the system done in mvc3.
But users are accessing the files directly through the browser URL,
example localhost/minhaapp/dados/relatorio1.html
, instead
access via an internal system option made in mvc3.
- Block access via GET method of the HTML files in the folder
/dados
?
But I want the system done in mvc3 to be able to access these files via POST method. This is not the safest method, there must be many other possibilities, but if you can do that you’d be fine.
I tried various shapes, rewrite, modules, urlmapping, mvc controler, etc, but none of these captures the browser request for static files. I know that static archive are served directly by iis.
But there is some way Asp.net can intercept static file requests?
If not possible via Asp.net, have some configuration that works in us Iss 8, 7.5 r 7?
I can not change to another folder, or save the files otherwise, IE, by internal issues (internal policies, already being so and very widespread and used by multiple clients), the form and location as the files are saved, CANNOT BE CHANGED.
A tip that might help: Save the file under the encrypted name (e.g., from ".html file" to "123asd.html"). So when the user tried to force the access it would not be able since it would not find file using the real name.
– Arthur Menezes
I also thought about it, but the file is saved via Excel by the user, so I would have to create a service to monitor the directory, and keep renaming. I hope there’s another way, or else I’ll have to do it.
– Junior BnuSC