How to restrict folder access in asp.net

前端 未结 4 1567
感情败类
感情败类 2020-11-28 11:15

How to restrict folder access in asp.net like I don\'t want any other to see my Uploads folder in browser by link http://www.example.com/Uploads

4条回答
  •  日久生厌
    2020-11-28 11:40

    You can do like @klausbyskov mentions, to add 's to the root web.config, like:

    
        
            
                
                
            
        
    
    

    or you can add a web.config to the folder where you want to allow/deny access with the following content:

    
    
        
            
                
                              
            
        
    
    

    Of course replace the and with you own rules

提交回复
热议问题