Hi Don,
I've looked at Bruces' code for BLOBs and it doesn't look finished, so looks like we are on our own.
But i'm sure it is possible. As the image is inside a BLOB, you'll probably not want to copy it from the BLOB and into a temp file as this is going to waste time and require cleanup.
This is what i'd do, it might seem a bit weird, but maybe someone can come up with a better idea
After you read this you might much rather store your images on the disk and not in BLOBs
1. We need to send the image to the client as if it is a normal image, so i need a syntax nettalk understands to mean "get me a blob but make it look like a image" .
So lets just make that up:
VirtualImage/Prefix_Sysid_Blobname.ImageType
Virtualimage is a folder under your WEB folder that does NOT exist (its imaginary). We do this so we can intercept this call at the WebServerHandler level.
Prefix is your file prefix so we can figure out what file the blob is in.
SysID is your unique field value to locate the correct record. (remember that every request to the web server has no idea what your were up to earlier, so everything needs to be passed)
Blobname is the name of your blob field, in case you have more than one in each file.
ImageType this is either JPG, PNG etc etc, otherwsie you might confuse the browser by not helping it identify what sort of image is arriving.
2. Now with this crazy syntax, we will now have enough info to find the record in question, load it, find the blob, and feed it down the pipe to the browser. Aweful huh, So lets intercept this syntax in WebServerHandler.
In the embed point _SendFile PROCEDURE in Local Objects of WebServerHandler
!the page/file requested wasn't one our our normal pages. So NetTalk will try and find it on the disk and send it, so in our case lets see if its one of our special ones
IF INSTRING('virtualimage/',lower(p_FileName),1,1) ~= 0
!Yeap, it starts with our special code virtualimage
This is where you parse the p_FileName variable pulling out all the bits we stuck in the image name, open the file, get the record, determine the file and have the BLOB ready
SELF.SendMemory(Pre:Blob[0:Pre:Blob{PROP:Size}-1],Pre:Blob{PROP:Size})
RETURN
.Now there are lots of little things to go wrong, but i've used a similar technique to redirect images from one server to another to get around Flash security, plus another similar technique to power an email tracking system (using imaginary images).
Hope that give you are few ideas, or discourages you away from BLOBs, or better still Bruce may rescue us both from my hacking.
Regards
Bill Shields