I am using MongoDB and GridFS, but I’d like to be able to include it within an image tag on a page called display, getimage.php being the page that got the image from Mongo, such as <img src='getimage.php' height='100px' width='100px'>
Would this be possible and if so what would be the implimentation for it?
Only using
getimage.phpwill be not enough. You should also provide an identifier for the image you want to retrieve. This way, you can use this technique for an unlimited number of images.If you use the files OID, you can easily get the image from GridFS. In
getimage.phpyou simply get the image based on the value provided with theoid=....param$oid = $_GET['oid'].