Reputation: 137
In the site I've been working on, I do have this feature where the user could upload his/her profile picture. When the user will click upload button, I want the file to be renamed to his/her username when uploaded.
I tried fetching the user's username from the database and assigning it as a name of the file to my view, but it didn't work.
<?php echo "<input type='file' name='".$row->username."' size='20' id='file' required/>"; ?>
And I think it's wrong. I also tried to get the value of data from an array from the model but it didn't work. I am really new to codeigniter, and this is my first time to encounter such things.
Upvotes: 0
Views: 33