Welcome Guest, Not a member yet? Register   Sign In
[SOLVED] Problems with Upload library
#1
Bug 
(This post was last modified: 05-27-2018, 05:32 PM by chapacua.)

Hello! 

Before anything i want to say that i'm not a English speaker so i want to apologize for any mistake i would do

So i'm trying to upload a file from form, using CI upload library, but it isn't work and give to me a error message.

This is the function that instance the library 

Code:
    public function createIngrediente()
    {
    
        $data = array
        (
            'Ing_Nombre' => $this->security->xss_clean($this->input->post('Ing_Nombre')),
            'Cat_Id' => $this->security->xss_clean($this->input->post('Cat_Id')),
            'Ing_Descripcion' => $this->security->xss_clean($this->input->post('Ing_Descripcion'))
        );

        $config['upload_path']          = './views/public/img/ingredientes/';
        $config['file_name']              = 'ingrediente';
        $config['allowed_types']        = 'gif|jpg|png';
        $config['max_size']             = 100000;
        $config['max_width']            = 1024;
        $config['max_height']           = 768;

        $this->load->library('Upload', $config);

        if ( ! $this->upload->do_upload('userfile'))
        {
                $error = array('error' => $this->upload->display_errors());

                $this->load->view('upload_form', $error);
        }
        else
        {
            var_dump($this->upload->data());
        }            
        //$this->Ingredientes_model->createIngrediente($data);
        echo 1;
        return true;
    }

And this is the error that i get when i run it

Code:
An Error Was Encountered

Unable to load the requested file: upload_form.php

I validate in System/Library folder and there is the Upload.php file i try too loading library from autoload and from Constructor method, but error persists
The current version i'm using is CI 3.1.8

Thanks a lot!
Reply


Messages In This Thread
[SOLVED] Problems with Upload library - by chapacua - 05-25-2018, 08:51 AM
RE: Problems with Upload library - by Paradinight - 05-25-2018, 09:31 AM
RE: Problems with Upload library - by chapacua - 05-27-2018, 05:31 PM



Theme © iAndrew 2016 - Forum software by © MyBB