I have a form with two text fields and a file upload field. The form works fine during upload. But when I click delete next to the file, and then try to upload a new one the field is blanked out. I can't click the "Upload a file" button to add a new file on that form. Here is my code:
function case_study() { $crud = new grocery_CRUD(); $crud->set_table( $this->router->method ) ->set_subject( 'case study' ) ->columns('title','content','filename') //Columns on display. ->display_as('title','Name of case study') ->display_as('content','Introduction for case study.') ->display_as('filename','Filename'); $crud->set_field_upload('filename','assets/documents'); //Add / Edit methods. $crud->fields('title','content','filename'); //Hidden auto-filled fields. $crud->change_field_type('date_added', 'datetime', date('d-m-Y h:i:s',time()) ); $crud->change_field_type('author', 'hidden', $this->session->userdata('userId') ); $crud->required_fields('title','content','filename'); $output = $crud->render();//Set output variable for view. $output->css_files[] = base_url().'css/grocery_crud.css'; //$this->_example_output($output);//Send to view. $this->_example_output($output); }
The database entry is still there but the file field is blank on the table where it shows all entries for the case_study db table.