2

I need to upload multiple image from grocery_CRUD Library on codeigniter framework.

I need step by step process !

$crud->set_field_upload('image','assets/uploads/products');
$crud->callback_after_upload(array($this,'resize_after_upload'));

Now this is working as a single image upload only. Anybody please to help ?

Andrey Korneyev
  • 26,353
  • 15
  • 70
  • 71
ram4587kmr
  • 41
  • 2
  • 8

1 Answers1

1

Try Grocery_Crud_Multiuploader library, I wrote long back, might help you, instructions are given in github, current library supports files as well as images

grocery_crud_multiuploader

Load library like below

function __construct()
{
       parent::__construct();
       $this->load->database();
       $this->load->helper('url');
       $this->load->library('grocery_CRUD');
       $this->load->library('Grocery_CRUD_Multiuploader');
}

In controller function

public function multi_upload()
{
   $crud = new Grocery_CRUD_Multiuploader(); 
   $crud->set_table('content');
   $crud->where('state', 1);   
   ...
   ...
   $config = array(
        /* Destination directory */
        "path_to_directory" =>'assets/grocery_crud_multiuploader/GC_uploads/pictures/',

       /* Allowed upload type */
      "allowed_types" =>'gif|jpeg|jpg|png',

      /* Show allowed file types while editing ? */
      "show_allowed_types" => true,

     /* No file text */
     "no_file_text" =>'No Pictures',

     /* enable full path or not for anchor during list state */
     "enable_full_path" => false,

     /* Download button will appear during read state */
     "enable_download_button" => true,

     /* One can restrict this button for specific types...*/
    "download_allowed" => 'jpg'
  );

  $crud->new_multi_upload("image",$config);
  ...
  ...
  $output = $crud->render();
  $this->_example_output($output);
}
Akshay Hegde
  • 16,536
  • 2
  • 22
  • 36
  • Sorry I didn't get you – Akshay Hegde May 29 '15 at 08:11
  • but this code view only for text box not a field field not showing! – ram4587kmr May 29 '15 at 08:14
  • Please elaborate your problem, did you try this library ? – Akshay Hegde May 29 '15 at 08:16
  • $crud_image->new_multi_upload("image",$config); //$crud->set_field_upload('image','assets/uploads/products'); //$crud->callback_after_upload(array($this,'resize_after_upload')); – ram4587kmr May 29 '15 at 08:17
  • it is just showing the text box only not a file field? – ram4587kmr May 29 '15 at 08:18
  • beginning the functions. `$this->load->library('ajax_grocery_CRUD'); $this->load->library('Grocery_CRUD_Multiuploader'); $crud = new ajax_grocery_CRUD(); $crud_image = new Grocery_CRUD_Multiuploader(); $crud_image->set_table('product'); $crud_image->fields('image'); ` – ram4587kmr May 29 '15 at 08:19
  • Please go through github, and read this [file](https://github.com/Akshay-Hegde/grocery_crud_multiuploader/blob/master/application/controllers/multiuploader.php), grocery crud doesn't support multiple upload, its custom library, please follow github instructions, – Akshay Hegde May 29 '15 at 08:20
  • Glad to know that it helped you – Akshay Hegde May 29 '15 at 17:44