File Type Block

Hello, I have a question. Can we block users from uploading certain file types? For example iso

Yes, you can do that with the file firewall which is part of the enterprise edition.

2 Likes

Thank you for your answer. Is there an alternative for Community Edition?

Actually in ownCloud Infinite Scale you can do it, I had ownCloud 10 in mind only when answering. Its a post-processing check you can setup.

Well, I knew I saw such an option somewhere. Even if I never tried it, it sounds promising.
From the file config/config.sample.php:

/**
 * Define blacklisted files
 * Blacklist a specific file or files and disallow the upload of files
 * with this name. `.htaccess` is blocked by default.
 *
 * WARNING: USE THIS ONLY IF YOU KNOW WHAT YOU ARE DOING.
 */
'blacklisted_files' => [
        '.htaccess'
  ],

/**
 * Define blacklisted files regular expression(s)
 * Blacklist files that match any of the given regular expressions and disallow
 * the upload of those files. The matching is case-insensitive.
 *
 * WARNING: USE THIS ONLY IF YOU KNOW WHAT YOU ARE DOING.
 */
'blacklisted_files_regex' => [
        '.*\.ext',
        '^somefilename.*'
  ],
3 Likes

it sounds promising, i try this but not work

'blacklisted_files_regex' => [
          '*.\iso',
          '*.iso',
  ],

If you use a valid regex, it will work. The file will then be refused.
Unfortunately, the blacklist-check will be performed AFTER the upload of the file, what I consider as nonsense.

2 Likes

I did it this way and it worked. tahk you so muchfor help. :slight_smile:

'blacklisted_files_regex' => [
          '.*\.iso',
  ],

2 Likes