CodeIgniter Forums
allowed_types error - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Installation & Setup (https://forum.codeigniter.com/forumdisplay.php?fid=9)
+--- Thread: allowed_types error (/showthread.php?tid=67624)



allowed_types error - taymaz-92 - 03-16-2017

Hi everybody.
i have an issue with upload library in codeigniter.
i have an image gallery in my project and i'm trying to upload images, i have a config array like this:
Code:
$config = array(
           'upload_path' => './uploads/images/',
           'allowed_types' => 'jgp|jpeg|png',
           'max_size' => 2048
       );
       $this->load->library('upload', $config);
 but it's not working and generates a file type not allowed error!
my problem solved with changing 'allowed_types' to "*", but now, user can upload any extension he wants!
i searched for solutions and tried to solve my problem with that, but problem is still there and i can't solve that! so i'll be gratefull if anybody can help me.

sorry for my bad English.


RE: allowed_types error - ivantcholakov - 03-16-2017

'jgp|jpeg|png' --> 'jpg|jpeg|png'