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
How to acees the image folder outside root directory ?
Moderator: General Moderators
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Re: How to acees the image folder outside root directory ?
Use an intermediary script to serve the image,
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']
Code: Select all
<img src="/image.php?image=foo.jpg">of course the filename in this case will be readable through $_GET['image']