How to enable new file extension for file upload


You can add new file extention for file upload at model file in folder /app/Model/. For example to add eps file extension in ProjectFile in FreelanceHQ script, here is the steps:

Open file /app/Model/ProjectFile.php using Notepad or Your prefferred text editor.

Find these lines in the file:

'isValidExtension' => array(
                'rule' => array('isValidExtension', array('xlsx', 'xls', 'docx', 'txt', 'doc', 'pdf', 'jpeg', 'png', 'gif', 'jpg'), false),
                'message' => 'Invalid file extension'
            ),

Add 'eps' to the rule as per below:

'isValidExtension' => array(
                'rule' => array('isValidExtension', array('xlsx', 'xls', 'docx', 'txt', 'doc', 'pdf', 'jpeg', 'png', 'gif', 'jpg', 'eps'), false),
                'message' => 'Invalid file extension'
            ),

Save the file and try upload it.