Happy new year everyone
My questions is how do i access images stored outside the public_html folder?
i have tried doing <img src="/home/user/images/hello.jpg" /> but this didn't work as the image didn't load. I looked at the image URL in the browser and saw it was
http://www.mywebsite...mages/hello.jpg
I don't know why the image link became like that.
Thanks for your help
Images won't display
Started by bfva, Jan 15 2009 01:15 PM
2 replies to this topic
#1
Posted 15 January 2009 - 01:15 PM
#2
Posted 15 January 2009 - 01:54 PM
The url ended up like that because browsers work from the document root, not the server root. It's a security thing.
In order to access files that reside outside of public_html, you need to create a script (i.e. PHP) to load and display the image for you. You also must be careful when doing this. If you're not, you could create a huge security hole.
In order to access files that reside outside of public_html, you need to create a script (i.e. PHP) to load and display the image for you. You also must be careful when doing this. If you're not, you could create a huge security hole.
#3
Posted 16 January 2009 - 09:53 AM
Thanks for your help, i'll use an absolute url instead, to avoid creating a security hole lol
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users
