NetTalk Central

Author Topic: Browse image from a blob field  (Read 8818 times)

jking

  • Sr. Member
  • ****
  • Posts: 419
    • View Profile
    • Email
Re: Browse image from a blob field
« Reply #15 on: May 27, 2022, 01:07:45 PM »
Thanks Jane!

jking

  • Sr. Member
  • ****
  • Posts: 419
    • View Profile
    • Email
Partially solved! Re: Browse image from a blob field
« Reply #16 on: May 27, 2022, 08:14:09 PM »
Hi Bruce,

     I have the download from BLOB issue "mostly" solved, using the following code in the _SendFile procedure embed:

Access:Documents.Open()
Access:Documents.UseFile()
Doc:Document_Name = p_web.GSV('myDOCFileName')

If Access:Documents.Fetch(Doc:DocName_key) = 0
    sendString.FromBlob(Doc:Document_Data)
    p_web.ForceNoCache = true
    !p_web.SendString(sendString,1,0,true)
    p_web.SendString(sendString,1,len(sendString),true)
    loc:done = true   
END

Access:Documents.Close()
If loc:done then return.


The key was setting the third line properly.  I created a session variable called myDOCFileName and set this as each row of the browse is selected.  It is set to Doc:Document_Name, which is the field containing the file name stored in the BLOB.  I can view/download all BLOB entries now.

The problem with the form Save and Cancel button still remains.  If I open the Documents Browse, then edit a record, the Save and Cancel buttons do not respond.  I see the busy indicator in the lower right of my browser screen.  If I comment out the _SendFile embed code (p_web.SendString(sendString,1,len(sendString),true)), then the Save and Cancel buttons do respond again.  Any thoughts on how to deal with this? 

By the way, Jane helped me get registered for the weekly NetTalk User Group webinar.  If I don't find a solution here I'll join the webinar on Thursday.

Thanks,

Jeff

jking

  • Sr. Member
  • ****
  • Posts: 419
    • View Profile
    • Email
Re: Browse image from a blob field
« Reply #17 on: May 28, 2022, 04:28:33 PM »
Hi Bruce,

     I have some more info on this issue. 

     First, the form in question, in my NT 12.41 app, where the Save and Cancel buttons do not respond when doing an update, is a pop-up form.  If I call the form normally, the Save and Cancel do respond as expected.  I have been able to duplicate this in a modified version of the web40 example app (Web40_JK.zip attached).

     Second, the DevTools console shows a JS error when the form is open and the Save/Cancel button is pressed.  Please see attached image (error.png).  Hopefully these can help you solve this issue for me.

Thanks,

Jeff
« Last Edit: May 28, 2022, 04:53:32 PM by jking »

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Browse image from a blob field
« Reply #18 on: May 29, 2022, 11:02:18 PM »
Hi Jeff,
yes the example is working correctly, but you are mixing two completely different parts of the example together to get yourself all confused :)
Let's chat in the webinar.

Bruce

jking

  • Sr. Member
  • ****
  • Posts: 419
    • View Profile
    • Email
Re: Browse image from a blob field
« Reply #19 on: May 31, 2022, 05:35:46 AM »
Thanks Bruce.  I have registered for the Thursday webinar.  In the meantime I attached a zip file of the modified version of the web40 example app I have been experimenting with.  It might be a good idea for you to download it so we can go over it and see where I have gone wrong.

Thanks,

Jeff

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Browse image from a blob field
« Reply #20 on: June 05, 2022, 10:54:43 PM »
updated app from the webinar Jeff.