Welcome Guest, Not a member yet? Register   Sign In
grocery crud callback question
#1

[eluser]bill19[/eluser]
Hello everyone,

I am working with the fantastic grocery crud library, but I'm having a problem with a callback.

Code:
$crud->columns('description','slideshow','price','address_number', 'address_street', 'address_city', 'address_province', 'address_country', 'address_postal' , 'contact_name', 'contact_email', 'contact_home_phone', 'contact_cell_phone', 'contact_form_email');
    
  
$crud->set_field_upload('slideshow','assets/uploads/files');

            $crud->unset_back_to_list();
            

            $crud->callback_after_upload(array($this,'example_callback_after_upload'));

        $output = $crud->render();

        $this->_example_output($output);  


function example_callback_after_upload($uploader_response,$field_info, $files_to_upload)
{
    $this->load->library('image_moo');

    //Is only one file uploaded so it ok to use it with $uploader_response[0].
    $file_uploaded = $field_info->upload_path.'/'.$uploader_response[0]->name;

    $this->image_moo->load($file_uploaded)->resize(800,600)->save($file_uploaded,true);

    return true;
}

This example comes right out of the documentation (http://www.grocerycrud.com/documentation...ter_upload ), but I can't get it working. I have checked and the file is being uploaded to the correct folder on my server.

Can anyone see what I'm doing wrong?

Thanks in advance,

Bill




Theme © iAndrew 2016 - Forum software by © MyBB