Error upload - Codeigniter

0

I am uploading a csv file, however it returns the invalid extension error, even though the extension is freed. I was looking for the cause of the error and found it is because of a line that is in the file.

if (!$this->upload->do_upload()) {
        $this->session->set_flashdata('erro', $this->upload->display_errors());
        redirect(base_url() . 'updb/up_numeros/' . $tipo);
        exit;
    } 

Between the lines of the csv file there is one with the following text:

COLUNA 1              COLUNA 2
C TESTE - 6173        2

When I delete the line or include an empty space or any other character in column 1, the upload is successful.

Does anyone have any idea where the error might be?

    
asked by anonymous 19.03.2018 / 15:29

1 answer

0

Attempts to put allowed_types .

Ex:

    $configUpload['upload_path']   = $path;
    $configUpload['file_name']   = $descricao;
    $configUpload['allowed_types'] = 'jpg|png|gif|pdf|zip|rar|doc|xls';
    $this->upload->initialize($configUpload);
    
22.03.2018 / 19:32