logo logo

Limit upload file by extention

Just when i am forget :)

<VirtualHost *:80>
    # ...

    <Directory /path/to/webroot/path/to/upload/folder>
        deny from all
        <Files ~ "^\w+\.(gif|jpe?g|png)$">
            order deny,allow
            allow from all
        </Files>  
        <IfModule mod_php5.c>
            php_flag engine off
        </IfModule>      
    </Directory>
</VirtualHost>

Don’t forget to enable mod_rewrite.

bottom

Leave a Reply

Your email address will not be published. Required fields are marked *

 

bottom