Temp file not found after closing

poppinspoppins Member Posts: 647
edited 2015-05-11 in NAV Three Tier
Hi everyone,

I created a temp file on the server, wrote some information on it, and then wanted to transfer the data I wrote to another file in the client side.
Here is the piece of code I wrote:
LogFile.CREATETEMPFILE();
LogFile.TEXTMODE(TRUE);
FileName := LogFile.NAME;
LogFile.WRITE('some info');
LogFile.CLOSE;
LogFile.OPEN(FileName);
cdu419.AppendAllTextToClientFile(FileName,rSalesSetup."Post & Print Logfile Path"+rSalesSetup."Post & Print Logfile Name"+'.txt');

I got the following error message:
This message is for C/AL programmers: A call to System.IO.File.ReadAllText failed with this message: Could not find file 'C:\ProgramData\Microsoft\Microsoft Dynamics NAV\70\Server\ddd\users\eee\www\TEMP\__TEMP__73abda84b2ed4d91933c5772f0dfb1da.tmp'.
__TEMP__73abda84b2ed4d91933c5772f0dfb1da.tmp is the name of the temp file I created (I checked).
What is going wrong? Is the file deleted when LogFile.CLOSE is executed?

Thanks in advance :mrgreen:
Sign In or Register to comment.