Bruce,
I'm uploading PDF's to a BLOB. The file name is stored in the field con:Consent_name. In the Validate embed for this field I have the following code:
If p_web.GSV('Con:Exp_Script') = 1
CL# = QuickPDF.CreateLibrary()
UL# = QuickPDF.UnlockKey('secret')
LS# = st1.LoadFile('.\ExpirationScript.txt')
p_web.SSV('tempfile', st.Random(16, st:upper)&'.PDF')
FB# = st2.FromBlob(Con:Consent_File)
SF# = st2.SaveFile(p_web.GSV('tempfile')
L# = QuickPDF.LoadFromFile(p_web.GSV('tempfile'), '')
Remove(p_web.GSV('tempfile'))
O# = QuickPDF.PageJavaScriptAction('O', st1.GetValue())
MD0# = QuickPDF.SetCustomInformation('ConsentID', p_web.GSV('Con:Consent_ID'))
MD1# = QuickPDF.SetCustomInformation('IRBNumber', p_web.GSV('Con:IRBNumber'))
MD2# = QuickPDF.SetCustomInformation('AppDate', p_web.GSV('Con:Consent_Approval_Date'))
MD3# = QuickPDF.SetCustomInformation('ExpDate', p_web.GSV('Con:Consent_Expiration_Date'))
p_web.SSV('tempfile', st3.Random(16, st:upper)&'.PDF')
S# = QuickPDF.SaveToFile(p_web.GSV('tempfile'))
LF# = st3.LoadFile(p_web.GSV('tempfile'))
B# = st3.ToBLOB(Con:Consent_File)
Remove(p_web.GSV('tempfile'))
END
This all works well with an Insert. Now, if I click change, to add a description or change a date, then save, the contents of my BLOB are altered. This also happens when I click change, but do nothing and click save to back out. I want the BLOB to change only if I upload another file during the change process. I have tried the Post Insert/Change and save file embeds as well, but can't figure this out.
Is there another embed or method I should look at? I need to control whether the BLOB is changed or not, based on if a new file is uploaded.
Thanks,
Jeff