2

1st. This is my 1st time using this plugin!

I created upload field :

$this->grocery_crud->set_field_upload('img_holder','assets/uploads/files');

This is ment for main image of article, but when i press it, i can choose file, it starts uploading and when it comes to 100 % it prompts:

An error has occurred on uploading

It gets prompted 2 times in a row from single upload.

Im sure i didn't call same field 2 times as an upload field, and im out of ideas how to fix this, is there some workaround on this ? or a fix ?

this is my whole controller code:

<?php class list_news extends CI_Controller {

function __construct()
{
        parent::__construct();


/* Standard Libraries */
$this->load->database();
$this->load->library('session');
$this->load->helper('url');

/* ------------------ */    
$this->load->library('Grocery_CRUD');    
}



function postovi($output = null)

{
if($this->session->userdata('logged_in'))
{
     $session_data = $this->session->userdata('logged_in');
     $data['username'] = $session_data['username'];
$this->load->view('list_news_view.php',$output);   
}
   else
   {
     //If no session, redirect to login page
     redirect('login', 'refresh');
   } 
}

function index()

{
$this->grocery_crud->set_field_upload('img_holder','assets/uploads/files');
$output = $this->grocery_crud->render();
$this->postovi($output);

}

}
?>
FTWwings
  • 105
  • 9

1 Answers1

0

If you are using a linux/Ubuntu, do this:

chmod -R 777 assets/uploads/files
chown -R archie:www-data assets/

"archie" as the user with sudo rights on the system.

סטנלי גרונן
  • 2,917
  • 23
  • 46
  • 68