0

am using codeigniter 2.

when i use the below i cant get the image. application/views/admin/images/image.png folder structure is correct.but the image is not coming there.from view source option i got the following

403 Forbidden

Forbidden

You don’t have permission to access /application/views/admin/images/image.png on this server.

am on local server wamp. if i put the image on root i can get it

but i was uing similar folder structures with codeigniter 1.7.3 those were working for me i dont know why its not with ci2 or i mde any mistake…..

2
  • 2
    I'm not a 100% sure about version 2, but in 1.7.3 you're not supposed to put the images inside your application folder. Resources should go in your public/webroot folder Commented Feb 27, 2011 at 4:47
  • It's probably because you placed the application folder in the webroot before but now you've placed it outside the webroot making it inaccessible. Commented Feb 27, 2011 at 4:55

2 Answers 2

6

Only .php view files are supposed to exist within the /application/views directory. You should store images in a directory like /images or /assets in the web root.

Sign up to request clarification or add additional context in comments.

1 Comment

Exactly right. Direct access to files within the application and system folder is forbidden as it can lead to security issues. Only views go in the views folder, images go in an images folder.
2

there may be .htaccess file in your root what deny write. Rename .htaccess and try again. if it works, you may edit .htaccess

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.