Works 100% in Grocery Crud and Codeigniter version 3
you'd configure your
in the folder
application/config/grocery_crud.php
$config['grocery_crud_file_upload_allow_file_types'] = 'gif|jpeg|jpg|png|tiff|doc|docx|txt|odt|xls|xlsx|pdf|ppt|pptx|pps|ppsx|mp3|m4a|ogg|wav|mp4|m4v|mov|wmv|flv|avi|mpg|ogv|3gp|3g2|apk';
With $crud->set_field_upload("image","assets/uploads/team","jpg|png"); you cant overide at all , it picks extension from above grocery_crud.php.
Finally in your controller ,this is my example :
function __construct() {
parent::__construct();
$this->load->driver('session');
$this->load->database();
$this->load->helper('url');
$this->load->library('grocery_CRUD');
$this->load->model('Generic');
$this->load->library('upload');
$this->load->helper(array('form','url'));
//$config['upload_path'] = './uploads/';
$config['allowed_types'] = 'gif|jpg|png|rar|zip';
$config['max_size'] = 100;
$config['max_width'] = 1024;
$config['max_height'] = 768;
$this->load->library('upload', $config);
$this->upload->initialize($config);
}
public function index() {
$crud = new grocery_CRUD();
...
//dondt forget to set some configuration of visibily from your crud pages where you want your Upload Input appears like...
$crud->fields("file_url" ...
$crud->add_fields("file_url"..
$crud->edit_fields("file_url"..
....
$crud->set_field_upload('file_url','assets/uploads/files');
$output = $crud->render();
....
}