Delete TEMP files on NAV server (NAV 2009 R2)

ASK_ITGASK_ITG Member Posts: 30
edited 2012-06-29 in NAV Three Tier
Hi,

I have made a report that allows a user to UPLOAD a file to the NAV server for processing the content of the file.

After completion, there now lies a file in the TEMP-folder for the NAV server (on my PC it is: C:\ProgramData\Microsoft\Microsoft Dynamics NAV\60\Server\MicrosoftDynamicsNavServer\users\xxxx\)

When reading about the UPLOAD function and the File.CLOSE function, I think it sounds like the file automatically should be deleted - but that doesn't happen until I restart the NAV server service - which I don't do that often...

Can someone perhaps explain how I get rid of the files without closing the service?

***************** THE CODE **********************

IF ISSERVICETIER THEN BEGIN
TempFile.CREATETEMPFILE;
FileName := TempFile.NAME + '.txt';
TempFile.CLOSE;
IF UPLOAD(Text001, '',Text002,'',FileName) THEN
ImportCU.ImportCPRStreetReg(FileName, "ANSI-ASCII", DistributionCode.Code);
CurrReport.QUIT;
END ELSE
ImportCU.ImportCPRStreetReg(FileName, "ANSI-ASCII", DistributionCode.Code);

******************END **************************
/Allan

Answers

  • krikikriki Member, Moderator Posts: 9,112
    Maybe this ?
    [Ok :=] ERASE(Name)
    
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


Sign In or Register to comment.