[eluser]Unknown[/eluser]
Code:
$config['file_name'] = $logged_in_user['user_name'].".png";
$config['upload_path'] = 'assets/profiles/';
$config['allowed_types'] = 'gif|jpg|png';
$config['remove_spaces'] = false;
$config['overwrite'] = true;
$this->load->library('upload', $config);
if ($this->upload->do_upload("picture")) {
$upload_data = $this->upload->data();
The goal is to change display picture of user. As user upload the file it should replace his existing picture with the new one.
The existing picture is hardcoded as username.png as it is a default image when user creates account.
Now by the above code. when it runs , it uploads the new file not by replacing the existing file instead it is making file name like username_.png .
I want the existing file to be replaced with new.
Kindly help
Thanks