NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: Rene Simons on June 08, 2022, 11:17:13 AM
-
Hi,
Is there someone who knows all the ins and outs of the File Upload?
- How, where and at which moment to change the upload-to location?
- How, where and at which moment to do the rename of the uploaded file?
- How, where and at which moment to find out if the upload is complete?
Cheers,
Ren?
-
Hi Renee,
File import and renaming happens in WebHandler. According to an old app ( and my recall of conversations with Bruce...)
Enbed p_web RenameFilePROCEDURE*(......)
Priority 5001 = AFTER Parent Call.
Here is my code: ( a little messy with messages )
MESSAGE('pname ' & p_name)
if p_name = 'upfilename' ! uploading schedule file
locpath = p_web.GSV('tProvRptDir') ! this is the provider file
! message('report dir ' & locpath)
locpath = clip(locpath) & '\INFILE\' ! this adds teh Infile path
! message('upload path: ' & locpath)
RETURNVALUE = Parent.RenameFile(p_name,p_filename,locpath)
RETURN RETURNVALUE
END
FWIW,
Ron Jolda
-
Hi Ron,
Thanks. That wil make 2 out of 3 a lot easier.
Ren?
-
RenameFile does not save the file. the form does that (in the SaveFile:: routine).
It is useful for renaming incoming file parameters though, at an "early point" when the name is coming in from the browser.
The SaveFile:: routine in your form calls the SaveFile method. That's usually where I modify the saving file name, and saving path if I want to.
>> How, where and at which moment to find out if the upload is complete?
by the time WebHandler sees it, it has already completely arrived.
Cheers
Bruce
-
Thanks Bruce