php - How to display photo from non-public folder? -


i have built website in way actual database files positioned follows

root/ root/httpdocs <- public folder root/databasefolder/actual_files_here/some_photo.jpg 

how can implement php can view/load photo databasefolder , echo tag. tried "../databasefolder/" in tag, doesn't work (of course doesn't), since it's hidden folder.

i tried base64 works in other browsers, not internet explorer, due silly kb limit.

in html:

<img src="image.php?image=some_photo.jpg" /> 

and php script echoes image.

header('content-type: image/jpeg'); echo imagejpeg('root/databasefolder/actual_files_here/' . $_get['image']); 

you can use parameter "image" load whatever image need folder.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -