Page 1 of 1

How to acees the image folder outside root directory ?

Posted: Wed Mar 26, 2008 5:06 am
by vijeee
How to acees the image folder outside root directory ?

I search google,yahoo

I given path like /home/chandama/images/ to upload it uploaded the file

But the path is not working for displaying the image

I also tested with ./home/chandama/images/ path

How can I give the path.

Need to change cofig file ?

Please help me

Re: How to acees the image folder outside root directory ?

Posted: Wed Mar 26, 2008 10:59 am
by John Cartwright
Use an intermediary script to serve the image,

Code: Select all

<img src="/image.php?image=foo.jpg">
this image.php should send the correct image headers using header() (take a look at the docs), then readfile() to read the actual file

of course the filename in this case will be readable through $_GET['image']