The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Limit File Types

Discussion in 'General Discussion' started by Doug E, Aug 8, 2009.

  1. Doug E

    Doug E Well-Known Member

    Joined:
    Aug 17, 2005
    Messages:
    58
    Likes Received:
    0
    Trophy Points:
    6
    Is there a way to limit file types in an addon domain folder?

    Or some way to limit file types through htacess or anything like that?

    Say I want to give a folder on a domain to someone to use and access via ftp, but they can only use it for html and css files and files under a certain size limit.

    Anybody know if this is possible and how?
     
  2. thewebhosting

    thewebhosting Well-Known Member

    Joined:
    May 9, 2008
    Messages:
    1,201
    Likes Received:
    1
    Trophy Points:
    38
    I do not think it will be possible to limit the file size for particular folder. However, you can try below code in .htaccess to limit file types for uploading.

    RewriteEngine On
    RewriteCond %{REQUEST_URI} foldername/
    RewriteCond %{REQUEST_URI} !\.(ext1|ext2|ext3|ext4|ext5)$ [NC]
    RewriteRule .* error-page.html [L]

    Note: Replace ext1, ext2..etc with the types of extensions you wish to disallow.
     
Loading...

Share This Page