NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: Richard I on February 12, 2023, 08:28:31 PM
-
Hi All,
I have deployed the FileDownload Example into my NT app by copying in from the example,
DocumentBrowse,DocumentForm and ServeDocument
Its working
However I now want to embed in, the ability to delete the file conditionally after serving
I presumed that the code to delete should be in the ServeDocument WetWeb Page and I have this in the Footer Routine 4 End
IF p_web.GSV('RemoveAfterServing') = 1
remove(loc:filename)
STOP('FileRemoved')
END
This doesnt work.....
The Stop is not found presumably because the p_web.GSV('RemoveAfterServing') is not found either
Recently I posted another request on the example, and it was suggested to use the Server Side code embed but there doesnt seem to be that option on the ServeDocument NetWeb Page
So
Where should I conditionally code the deletion after serving please?
many thanks
Regards,
Richard
NT 12.54
-
Hi Richard
When when you (conditionally) let the file name start with '$$$' before serving,
it will be removed after it is served.
Ren?
-
In S3reve Document is a Footer procedure.
this contains
p_web._Sendfile(loc:fileName)
If you want to delete the file after sending it, then by all means add code in here after that call.
As Rene notes, if your filename starts with $$$ then the file is deleted for you by _sendfile.
Cheers
Bruce
-
Thanks Rene and Bruce
Rene, thanks, I am familiar with '$$$' and I will look at using this but I prefer to 'hand code' these sorts of things, so I have used remove(loc:filename) after the Send as described ny Bruce
Cheers
Richard
-
>> I prefer to 'hand code' these sorts of things,
why?