NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: Rene Simons on June 08, 2022, 11:17:13 AM

Title: File upload: Ever lasting question
Post 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?
Cheers,
Ren?
Title: Re: File upload: Ever lasting question
Post by: rjolda on June 08, 2022, 03:14:37 PM
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
Title: Re: File upload: Ever lasting question
Post by: Rene Simons on June 08, 2022, 11:46:23 PM
Hi Ron,

Thanks. That wil make 2 out of 3 a lot easier.

Ren?

Title: Re: File upload: Ever lasting question
Post by: Bruce on June 10, 2022, 04:11:18 AM
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
Title: Re: File upload: Ever lasting question
Post by: Rene Simons on June 10, 2022, 03:15:11 PM
Thanks Bruce