Reputation: 87
I have a series of images I wish to display on a site using the HTML img tag.
e.g. <img src='some/location' />
However the image is located in a different directory outside of the web root. (but still on same server).
Moreover it has been saved as a hashed value using php's md5_file()
How do I go about displaying the image on the site, even if I can get to the file somehow, it has been saved differently?
Upvotes: 0
Views: 685
Reputation: 3656
You have to do something like <img src="image.php?img=whatever">
. Your image.php file will need to grab the image outside of the web root, as well as decode it for viewing.
You can force a .jpg (or whatever) extension using URL rewrites.
Upvotes: 1