Welcome Guest, Not a member yet? Register   Sign In
You did not select a file to upload.

Hi. When i try to do a form without a imagem, i recive this message: "You did not select a file to upload."

My controller:

        $user = $this->ion_auth->user()->row();

        $config['upload_path'] = 'imagem_upload';
        $config['allowed_types'] = 'jpg';
        $config['max_size'] = 3000;
        $config['max_width'] = 1000;
        $config['max_height'] = 1000;
        $config['encrypt_name'] = TRUE;

        $this->load->library('upload', $config);
        if (!$this->upload->do_upload('userfile')) {
            echo $this->upload->display_errors();
        } else {

            $arquivo_enviado = $this->upload->data();
            $data['userfile'] = $arquivo_enviado['file_name'];

anyone can help me ?

put your image upload code inside a

if ($_FILES){... }

condition. This way it will only fire if you are actually uploading a file. (You may want to put that part inside a if ($_POST){... })

i will try this, ty so much!

Theme © iAndrew 2016 - Forum software by © MyBB