i have this scenario in a codeigniter form_open_multipart:
now i want to upload the file with the name of the "Nome File" Field
this is my code:
public function aggiungiDocumento(){
$nomeFile = $this->input->post('nomeFile');
echo $nomeFile;
$document = $_FILES['document']['name'];
echo $document;
if($document=''){
}
else {
echo getcwd() . "
";
$config['upload_path']='./aziende';
echo $config['upload_path'];
$config['allowed_types']='jpg|gif|png';
$this->load->library('upload', $config);
if(!$this->upload->do_upload('document')){
echo "nope";
}
else{
echo "yup";
$config['file_name'] = $nomeFile;
echo $config['file_name'];
$document=$this->upload->data('file_name');
}
}
the upload work with the name of the attached not with nomeFile of the field that i posted
sorry for the english :) anyone can help me ? thanks a lot