我有一个用户使用表格认证登录的网站, 并有一个文件夹路径, 我不想让任何未经认证的用户( 那些未登录的用户) 下载文件。 我如何执行此操作?
谢谢
萨钦
我有一个用户使用表格认证登录的网站, 并有一个文件夹路径, 我不想让任何未经认证的用户( 那些未登录的用户) 下载文件。 我如何执行此操作?
谢谢
萨钦
您可以通过配置完成此操作, 见< a href="http://msdn.microsoft.com/ en- us/library/8d82143t.aspx" rel=“ nofollow” >http://msdn.microsoft.com/ en- us/library/8d82143t.aspx
<location path="Files">
<system.web>
<authorization>
<deny users="?"/>
</authorization>
</system.web>
</location>
您可以让函数下载( 在服务器侧面), 在那里您将检查当前登录, 然后将路径发送到文件, 供可访问的人使用 。
这里您可以看到其他方法 < a href=" "https://stackoverflow.com/ questions/5310774/ how-to-stop-user-not-get-files-if-not-login">get-files-if-login
将文件放置到授权文件夹中。 这样如果未经授权的用户来到该文件夹, 他们将被重定向到登录页面以获得授权 。
In an ASP.NET web app, using Integrated Windows Authentication, is the session tied to the windows identity? In other words, if I login (using IWA) to the app, and the app stores some "stuff" in my ...
Does anyone know if I can use Elmah with Visual Studio build-in web server(aka Cassini)? I get it working easily on IIS, but using same configuration, it doesn t work with Cassini. When I requested ...
I want to set the hostname for a website I m adding in IIS 7, however do I include the www in the hostname or not? because I want both www.mysite.com and mysite.com both to point to mysite on the ...
I m developing an ASP.NET MVC site that utilizes forms authentication for part of the application. During development, I need to be able to give external parties access to a development server hosting ...
I ve run websites out of inetpub, as well as from folders just residing on the C: drive. I wonder, are there any definitive advantages to running websites out of inetputwwwroot?
I am having issues with one of our web-services. It works fine on my development machine (win XP) whether I host it as a separate application or using cassini from Visual studio. Once I deploy on the ...
The following line of PowerShell works with IIS 6 installed: $service = New-Object System.DirectoryServices.DirectoryEntry("IIS://localhost/W3SVC") However, with IIS 7 it throws the following error ...
Recently my ISP switched our website to an IIS7.0 high availibility cluster. The website is running on PHP5.2.1 and I can only upload files (so no registry tweaks). I had tested the website before and ...