Page 1 of 1

accessing image from folder other than htdocs

PostPosted: 18. August 2012 15:18
by alexreborn
script is img src="../php/bin/abc.jpg"
abc.jpg is present there but image is not displayed...
what is the problem and what can be done to resolve it??????????

Re: accessing image from folder other than htdocs

PostPosted: 18. August 2012 20:06
by Altrea
Hi alexreborn (there is ALWAYS time for a short salutation, especially if you are asking for help on a community board. It's a matter of politeness),

alexreborn wrote:what is the problem and what can be done to resolve it??????????

Simple answer: Images will be requested by the client browser and you can't request files that are outside of the DocumentRoot.
Saving all asset files inside DocumentRoot which are needed to be requestable is the most common and recommend way.

What should be the sense of having images outside DocumentRoot?

best wishes,
Altrea

Re: accessing image from folder other than htdocs

PostPosted: 19. August 2012 06:18
by alexreborn
@ Altrea i knew dis.. bt sum1 told me dat it can be accessed and asked me to find it out....
anyways thankyou for your valuable tym and answer...

Re: accessing image from folder other than htdocs

PostPosted: 19. August 2012 09:22
by Altrea
alexreborn wrote:@ Altrea i knew dis.. bt sum1 told me dat it can be accessed and asked me to find it out....

Then that someone should tell you the URL to find it out yourself.

Sure, there are some ways to configure the Apache to make files in other directorys accessible (Alias, AliasMatch) or fetching the image with PHP.
But this is very uncommonfor most situations.

best wishes,
Altrea