I have upload folder and i want people can't dirrect access into that folder. But people can download file from that folder from a button. Is this possilbe ? If yes, how i can setting on .htaccess ?
            Asked
            
        
        
            Active
            
        
            Viewed 32 times
        
    2 Answers
0
            
            
        You can write simple php script that will return certain file, example here PHP - simple download script and deny access to uploads folder like here Deny access to one specific folder in .htaccess
 
    
    
        mcyg
        
- 307
- 2
- 12
0
            
            
        Put the following line in your upload/.htaccess file:
deny from all
This will make that the contents cannot be listed, but can still be downloaded when the user knows the filename (or - in your case - is linked to that file from a button).
If you want to keep access to the open directory for yourself, you can add the following line (in addition to the previous):
allow from [your ip address]
 
    
    
        Daan
        
- 578
- 7
- 21
 
    