Image not showing in codeigniter 4 - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30) +--- Thread: Image not showing in codeigniter 4 (/showthread.php?tid=74782) Pages:
1
2
|
RE: Image not showing in codeigniter 4 - John_Betong - 11-07-2019 @durairaj > 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. RE: Image not showing in codeigniter 4 - durairaj - 11-07-2019 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 ); } //view <img src="<?=base_url();?>/public/assets/avatar/<?=$value->avatars?>"> that is step...worked for me thanks for helping me. RE: Image not showing in codeigniter 4 - John_Betong - 11-07-2019 Thank you |