NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: ProAssist on December 12, 2016, 02:02:36 PM
-
I am trying to display an image from a SQL blob field. The blob contains the full size image. I think a browse with a child update memory form could display the full size image each time the user selects a row from the browse. Do I extract the blob in the webhandler procedure? Do I load the blob into a stringtheory string? How do I display the string containing the image?
Thanks
-
Hi Pro,
so to be clear, you want a browse on say one side of the page, and an image on the other.
Then as the user highlights a row in the browse the image displays?
Sort of what ABC calls a "hot field".
This is straight-forward to do, but there are some subtleties in play because of the way browsers do images.
I suggest we chat about this at this Thursday's webinar and I can show you the pieces you need to put together.
Hints: You'll have a form, withh 2 fields, the browse and the image.
On a row selection of the browse you'll reset the image control to a new _name_.
Then in web handler you'll "see" that name in _SendFile, and load the appropriate table row, and serve the blob.
Cheers
Bruce
-
Not sure if this helps, but here's the pseudo code I've used to serve blobs.
In the _SendFile embed like Bruce says, if p_Filename is what you are looking for:
self.ForceNoCache=0
self.HeaderDetails.CacheControl=''
self.ReplyContentType='image/jpeg'
self.SendMemory(loc:Image_Blob,loc:Image_Size)
dispose(loc:Image_Blob)
You also need to then skip out of the template PARENT._SendFile(p_FileName,p_header) call that comes directly after the embed in _SendFile, wrap it in an "else / end" statement.
In data somewhere:
loc:Image_Blob &string
loc:Image_Size long
-
Thanks for the pseudo code Stu - I inserted it just above the parent call but I am getting an unknown procedure name on the self.SendMemory statement.
-
see FileDownload example for sending a file from a blob.
cheers
Bruce