Menu
Welcome, Guest
Username: Password: Remember me

TOPIC: File upload restriction to only docx

File upload restriction to only docx 3 months 1 week ago #87033

  • sghauri
  • sghauri's Avatar
  • Offline
  • New Member
  • Posts: 2
  • Karma: 0
I want to restrict file type. For example I want only docx can be uploaded.
The administrator has disabled public write access.

File upload restriction to only docx 3 months 1 week ago #87064

  • diligent
  • diligent's Avatar
  • Offline
  • Moderator
  • Posts: 99
  • Thank you received: 28
  • Karma: 3
Hi,
as far as I remember the config only offers to define "bad" file extensions that can't be uploaded. You could add a large list of extensions there.

In case no one else has a better idea, you could also dig through the source files and hardcode your restriction.

E: default bad extensions are:
'upload_badext' => 
  array (
    0 => 'php',
    1 => 'php3',
    2 => 'php4',
    3 => 'php5',
    4 => 'pl',
    5 => 'cgi',
    6 => 'py',
    7 => 'asp',
    8 => 'cfm',
    9 => 'js',
    10 => 'vbs',
    11 => 'html',
    12 => 'htm',
    13 => 'phtml',
  ),
Last Edit: 3 months 1 week ago by diligent.
The administrator has disabled public write access.
The following user(s) said Thank You: pgr
Time to create page: 0.039 seconds
Powered by Kunena Forum