문제

I have a website into which users log in using forms authentication, with a folder path from which I do not want any unauthenticated users (those users not logged in) to download files from. How can I implement this?

Thanks,

Sachin

도움이 되었습니까?

해결책

You can do this through configuration, see http://msdn.microsoft.com/en-us/library/8d82143t.aspx

<location path="Files">
   <system.web>
     <authorization>
       <deny users="?"/>
     </authorization>
   </system.web>
</location>

다른 팁

You can make function to download (on server side) where you will check current login and then send path to file for accessible people.

Here you can see another ways get-files-if-login

Place the file in an authorised folder. so that if unauthorised users come to that folder. they will be redirected to login page to get authorised.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top