⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Cannot upload file on edit screen



Adamantus
  • profile picture
  • Member

Posted 13 February 2013 - 11:01 AM

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.


Adamantus
  • profile picture
  • Member

Posted 13 February 2013 - 14:06 PM

Sorry once again this seems to be an issue on one of my pcs. I keep forgetting about this issue. You can remove this topic if you wish.


fernandorengifo
  • profile picture
  • Member

Posted 19 February 2013 - 17:03 PM

Hello friend! I am very new to using grocery crud, I've been trying to upload pictures and I could not, set_field_upload ('field', 'assets / uploads / file') buttom of the file upload does not work. any suggestions?