Hi, I think you are saying here your process is not working because you cant identify the uploaded file.
In the WebHandler you have a Proc called "P_Web.SaveFile"
This is the handler saving the file to disk, it has a name of p_filename
In my example I wanted to change the path of the incoming file depending on the user working with a lesson or a assessment, Here is my code in the handler, you should see how I am using the filename
Note, the Case statement is me trapping which form sent this in.
If you want an app that does this, let me know
K
p_web.SaveFile PROCEDURE(STRING p_name,<STRING p_filename>)
ReturnValue ANY
! Start of "NetTalk Method Data Section"
! [Priority 5000]
! End of "NetTalk Method Data Section"
CODE
! Start of "NetTalk Method Executable Code Section"
! [Priority 2500]
Case self.GetSessionValue('updateFile')
of 'LessonLine' ! this is a D&D in redactor
if p_filename > '' ! D:\appname\web\uploads\cat.jpg
if p_name = 'file' ! changed to LL:LessonId
CreateDirectory( 'Web\Lesson\' & self.gsv('LL:LessonId') )
s200 = p_filename
s200 = strTh.FileNameOnly( s200 )
self.ssv('_KHdr FNameOnly=', clip(s200) )
s200 = 'Lesson\' & self.gsv('LL:LessonId') &'\'& s200 ! Web relative
p_filename = clip(p_web.site.WebFolderPath) &'\'& s200
self.ssv('_KHdr FName=', p_filename )
;.;.
of 'LessonResource'
if self.gsv('lres:filename') > ''
s200 = strTh.FileNameOnly( self.GetSessionValue('lres:filename') )
CreateDirectory( 'Web\Lesson\' & self.gsv('les:id') )
s200 = 'Lesson\' & self.gsv('les:id') & '\' & s200
self.SSV('lres:filename', s200)
p_filename = clip(p_web.site.WebFolderPath) &'\'& s200
self.ssv('_KHdr FName=', p_filename )
end
of 'AssesmentMasterQuestion'
!- then we are saving an asssessment - change uploads to Assessment\id
if self.GetSessionValue('amq:mcimage') >''
s200 = strTh.FileNameOnly(self.GetSessionValue('amq:mcimage') )
CreateDirectory( 'Web\Assessment\' & self.gsv('amq:id') )
s200 = 'Assessment\' & self.gsv('amq:id') & '\' & s200
self.ssv('amq:mcimage', s200)
p_filename = clip(p_web.site.WebFolderPath) &'\'& s200
self.ssv('_KHdr FName=', p_filename )
end
end