Hi
I have the following code fragment
#TempFile.CreateTemporaryFile
#Request.Response.AsFile Autodelete(True) Path(#TempFile)
#FileStream.Path := #TempFile
Which all works beautifully but I've noticed my \tmp folder is filling up with files like
QACXCAYX2M
QACXCR5FHZ
QACXC1W4KL
QACXDCA0W2
QACXDKR36C
Which contain the json I'm getting back in my response
Isn't the Autodelete supposed to take care of this or have I missed something?
XPRIM_HttpRequest
Re: XPRIM_HttpRequest
The original code I provided was not correct - my apology for that.
Providing the path when calling AsFile is the culprit as that stops the auto delete from doing its job.
Can you change the #TempFile type to #PRIM_ALPH
And change the AsFile invocation like so:
That should delete the file when #Request goes out of scope.
Take special care when you are using the file as an output of a web service - as that require to file to live beyond the normal runtime scope.
Providing the path when calling AsFile is the culprit as that stops the auto delete from doing its job.
Can you change the #TempFile type to #PRIM_ALPH
Code: Select all
Define_Com Class(#PRIM_ALPH) Name(#TempFile)
Code: Select all
#Request.Response.AsFile Autodelete(True) Result(#TempFile)
Take special care when you are using the file as an output of a web service - as that require to file to live beyond the normal runtime scope.