Skip to content

Restriction by file type

Prasath Mani edited this page Jan 1, 2020 · 1 revision

There is ways to restrict upload regarding file extension with a logic similar to Apache access control.

  • allowed upload extensions are listed as an array into $allowed_upload_extensions variable
  • allowed create and rename file extensions are listed as an array into $allowed_file_extensions variable
// Allowed file extensions for create and rename files
// e.g. 'txt,html,css,js'
$allowed_file_extensions = 'txt,html,js,css,scss';

// Allowed file extensions for upload files
// e.g. 'gif,png,jpg,html,txt'
$allowed_upload_extensions = 'jpg,jpeg,gif,txt,mp4';