$config['file_name'] = $logged_in_user['user_name'].".png";
$config['upload_path'] = 'assets/profiles/';
$config['allowed_types'] = 'gif|jpg|png';
$config['overwrite'] = true;
$this->load->library('upload', $config);
if ($this->upload->do_upload("picture")) {
print_r($this->upload->data());
$upload_data = $this->upload->data();
}
When i am running this function i have already a file abc.png
in my directory. As the upload methods runs, it is saving a file with abc_.png Why it is appending underscore? I read in other post here that this could be because of spaces. But i dont think there is any space in $config['file_name'] = $logged_in_user['user_name'].".png";
Please note that the already existed abc.png is pure PNG image while the file i am uploading is actually a jpeg image which i concatenate with .png just to make the file name same. I will do image conversion later after fixing this issue.
Thanks