I was adding an automated PDF generation script in an existing website, where the images are storted in the blob field of a mySQL DB. But in TCPDF that I have found good to generate PDF files on the fly, it needs something like myImageFileID.jpg or myImageFileID.png to display the image in it's PDF document. Problem is, when the image is stored in the database, we use a link like myImageFile.php?id=$myImageID while displaying the image in a webpage. I need a solution where I can use myImageFileID.jpg or myImageFileID.png while keeping the images as binary in the blob field, instead of using a link like myImageFile.php?id=$myImageID. Cany anyone help? Thanks.
Save this as .htaccess RewriteEngine On RewriteRule ^myImageFile(\d+)\.jpg$ myImageFile.php?id=$1 Code (markup):