NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: Richard I on November 24, 2015, 06:46:20 PM
-
Hi there,
my earlier posts refer,
I am trying to save an image path string into a tps file.
My Nettalk template has coded this...
and the STOP statement returns the full path name,which is good cause thats what I want to save.
! End of "Set File Name"
p_web.SaveImage('LOG:Photo',loc:filename,p_web.GetValue('_image_'))
LOG:Photo = loc:filename
p_web.SetSessionValue('LOG:Photo',LOG:Photo)
! Start of "Save File"
! [Priority 5000]
STOP('LOG:Photo= '& log:Photo)
! End of "Save File"
Somewhere I want to save this full path name string into a string field in the LOG TPS file in the field LOG:Photo ( LOG:Photo is a string 255)
This is happening on a FORM
and I need the path saved on Insert and Update.
but Im not sure of the embed point or the code to use
Can you please help?
Thanks
regards
Richard
-
Using a STOP is a bad debugging idea, and can prevent your server from working correctly.
Use p_web.TRace instead, and view the output in Debugview.
For information on what to embed, and where, an example is required.
cheers
Bruce
-
Hi Richard,
Not withstanding Captain Bruce's comments ..
If you're talking about having a netwebform with a file upload field on it, and you want to save the selected file (if uploaded) on insert or update, that's relatively straight-forward.
1. Assuming that the form is a FILE form for the tps file, In the ValidateAll, End embed, after running any manual code checks you need to (like is the filename not empty and does the file exist), put:
LOG:Photo = loc:filename
2. If the form is not for the tps file, then in that same embed you'd want to write some record retrieval and save code to wrap the above line.
** Another option is to create a routine that has the check + assignment code and then call it in the PostInsert and PostUpdate routines.
Not sure if that's what you were asking, but there you go.
-
Hi Stu,
Many thanks for your post.
I needed the validate All END embed
This is the code and its working as I want it.
earlier I set LOG:Photo=loc:filename
Im saving the BLOB in a separate folder as Bruce suggested
Cheers
Richard
p_web.trace('log:photo in validateall ='& LOG:Photo)
OPEN(Photolog)
set(Photolog)
phlog:Photo = LOG:Photo
phlog:name = p_web.GetSessionValue('Employee')
phLOG:Department = p_web.GetSessionValue('Department')
phLOG:DateIn = TODAY()
phlog:timein = Clock()
phlog:timeout = Clock()
phlog:mobile = 1
access:Photolog.INSERT()
p_web.trace('phlog:phot0 in validateall = '& phLOG:Photo)
Set(Photolog)
loop until access:photoLog.next()
FILETOBLOB(phlog:photo,phlog:photograph )
access:Photolog.Update()
END
-
Great to hear Richard!
It's a never-ending learning experience working with Nettalk. Love it!