• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Image not showing in codeigniter 4

#11
@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.
download and make your system directory strict
Reply

#12
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.
Reply

#13
Thank you Smile
download and make your system directory strict
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.