I am trying to display an image that I manually uploaded using the cPanel File Manager (or Eclipse Import), using the following in a View:
<img src="/app/public/images/logos/DoesNotShow.jpg">
and it does NOT show up. When I take another jpg that already existed:
<img src="/app/public/images/logos/DoesShow.jpg">
it displays perfectly. If I download DoesShow.jpg from the cPanel File Manager, rename it WillThisShow.jpg, and then upload (using cPanel File Manger) WillThisShow.jpg to the same folder, and put the following in the view:
<img src="/app/public/images/logos/WillThisShow.jpg">
it also does NOT display.
I inspected the non-uploaded and the uploaded, and the full correct path was shown for both.
Any ideas?
2
Answers
Make sure you have sent your base url
$config['base_url'] = 'http://example.com/'
end it with/
so you dont have to use it on view. Also make sure you images are outside of the applicationconfig/autoload the url helper.
Then on the image
<img src="<?php echo base_url('app/public/images/logos/WillThisShow.jpg');?>"
Use this If your baseUrl not ending with
/
eg:http://demo.com
thenOR
Change the permission to
0644