Welcome Guest, Not a member yet? Register   Sign In
Image not showing in codeigniter 4

> thanks a lot. you helped me lot,no words to say thank you.it's working

For the benefit of other users who may have the same problem, please explain the steps required to display the image.

working code
// created assets/avatar directory in public
//Controller in add function
use CodeIgniter\Files\File; // use above the class.

function add() {
$file = new File( $this->request->getFile( 'avatar' ) );
$ext = $file->guessExtension();
$name = 'avatar_'.$insert_id.'.'.$ext;
$PATH = getcwd();
$avatar->move( $PATH .'\assets\avatar', $name );
<img src="<?=base_url();?>/public/assets/avatar/<?=$value->avatars?>">

that is step...worked for me
thanks for helping me.

Thank you Smile

Theme © iAndrew 2016 - Forum software by © MyBB