Welcome Guest, Not a member yet? Register   Sign In
image not displaying
#1

[eluser]Unknown[/eluser]
In the views, I have a php file that displays the image.
Inside the body, I have &lt;img src="..."&gt;</img>
When I use an image link address from the internet, it's displaying the image.
But if I reference an image in the img folder, it will display a question mark(in safari browser).
Is there some configuration for file access in codeigniter?
#2

[eluser]pickupman[/eluser]
A common configuration when using Codeigniter is to have clean urls. This can present an issue for some users , and how they are used to creating links to images. Urls can be relative or absolute. A relative url is something like <img src="my-image.jpg" /> whereas an absolute url would be <img src="http://yoursite.com/my-image.jpg" /> or <img src="/my-image.jpg" />. A relative url will be from the image name being appended to the current directory in your address bar. Since CI uses clean url's, a relative path is trying to append the image path from possible a name of the controller or view folder which doesn't exists.

To check if this is your problem, first try using the full address to the image. <img src="http://yoursite.com/my-image.jpg"/>.

If you are putting your images inside of the application folder, they are being blocked from the .htaccess file located in /application folder.




Theme © iAndrew 2016 - Forum software by © MyBB