I need to upload or store some files, which I keep the path in the database and that file I send to a folder with a main route. The error comes when I upload my file, it saves me but it does not check that it is really good, for it I put it that when uploading the file the state sends a green check if I charge it correctly.
But I get this error after asking so much why I did not load the array: Array ([name] = > Array ([0] => CONSOLIDATIONOREQUERIMIENTO.docx) [type] => Array ([0] => application / vnd.openxmlformats-officedocument.wordprocessingml.document) [tmp_name] = > Array ([0] = > C: \ xampp \ tmp \ php9AE1.tmp) [error] = > Array ([0] => 0) [size] => Array ([0] = & gt ; 131975)) 11
I leave the code so they can understand what I mean: public function others_data () {// Reload other attachments (DETAILS OF MANAGEMENT) $ nro = count ($ _ FILES ["file_other"] ["name"]);
for ($i = 0; $i < $nro; $i++) {
print_r($_FILES["archivo_otros"]);
$file_name = $_FILES["archivo_otros"]["name"][$i];
$file_size = $_FILES["archivo_otros"]["size"][$i];
$file_type = $_FILES["archivo_otros"]["type"][$i];
if ($file_name != "") {
$nombre_archivo = $file_name;
if (!file_exists('./files/others/' . $nombre_archivo)) {
mkdir('./files/others/', 0777, true);
}
$path = "files/others";
copy($_FILES["archivo_otros"]['tmp_name'][$i], $path . '/' . $nombre_archivo);
$datos = array(
'nombre' => $nombre_archivo,
'ruta' => 'C:/xampp/htdocs/cnr/' . $path . '/',
'tipo' => 'Otros',
'detalle_actividad_id' => $_POST['idDetalle']
);
$this->submit_model->form_insert($datos, 'archivos_adjuntos');
} else {
$errors = array('error' => 'Error con: {$file_name}');
}
}
$where=array(
'field' => 'detalle_actividad_id',
'condition' => $_POST['idDetalle']);
$datos_2['estatus_control'] = 'En Trámite';
$this->submit_model->form_update($datos_2, 'control_actividades', null, $where);
$url = base_url('process/index') . '?cty=' . $_POST['cty'] . '&cpy=' . $_POST['cpy'] . '&prc=' . $_POST['prc'] . '&lab=' . $_POST['lab'] . '&sol=' . $_POST['app'];
//redirect($url, "refresh");
}
Comment the line where the refresh is to know what you were giving me