public function index() { // No required if you have set timezone already... :) if (!ini_get('date.timezone')) { date_default_timezone_set('GMT'); } try { $crud = new Grocery_CRUD_Multiuploader(); $this->db = $this->load->database("default", true); $crud->set_table('multi_uploader_gallery'); $crud->set_subject('Document'); $col = array("title", "my_pictures", "my_files", "my_mail_attachments"); $crud->fields($col); $crud->columns($col); $config = array("path_to_directory" => 'assets/grocery_crud_multiuploader/GC_uploads/pictures/', "allowed_types" => 'gif|jpeg|jpg|png', "show_allowed_types" => true, "no_file_text" => 'No Pictures', "enable_full_path" => false, "enable_download_button" => true, "download_allowed" => 'jpg'); $crud->new_multi_upload("my_pictures", $config); $config = array("path_to_directory" => 'assets/grocery_crud_multiuploader/GC_uploads/files/', "allowed_types" => 'pdf|doc|html', "show_allowed_types" => true, "no_file_text" => 'No files', "enable_full_path" => false, "enable_download_button" => true, "download_allowed" => 'pdf'); $crud->new_multi_upload("my_files", $config); $config = array("path_to_directory" => 'assets/grocery_crud_multiuploader/GC_uploads/mail/', "allowed_types" => 'txt|dat', "show_allowed_types" => true, "no_file_text" => 'No attachments', "enable_full_path" => false, "enable_download_button" => true, "download_allowed" => 'dat'); $crud->new_multi_upload("my_mail_attachments", $config); $output = $crud->render(); $this->Output_HTML($output); } catch (Exception $e) { show_error($e->getMessage() . ' --- ' . $e->getTraceAsString()); } }
public function multi_upload() { $crud = new Grocery_CRUD_Multiuploader(); $crud->set_table('images'); $config = array("path_to_directory" => 'assets/grocery_crud_multiuploader/GC_uploads/pictures/', "allowed_types" => 'gif|jpeg|jpg|png', "show_allowed_types" => true, "no_file_text" => 'No Pictures', "enable_full_path" => false, "enable_download_button" => true, "download_allowed" => 'jpg'); $crud->new_multi_upload("images_url", $config); $output = $crud->render(); $this->_example_output($output); }