Problem with UPLOADINTOSTREAM function

poppinspoppins Member Posts: 647
edited 2013-08-01 in NAV Three Tier
Hi everyone,

I am having a trouble with the following piece of code run from a codeunit:
FileName := 'C:\SomeFile.txt';
ok := UPLOADINTOSTREAM('','<TEMP>','Text Files (*.txt)|*.txt',FileName,NVInStream);
IF ok THEN BEGIN
  BLOBRef.Blob.CREATEOUTSTREAM(NVOutStream);
  COPYSTREAM(NVOutStream,NVInStream);
  EXIT(FileName);
END;
ErrorMessage := GETLASTERRORTEXT;
IF ErrorMessage <> '' THEN
  ERROR(ErrorMessage);
EXIT('');

I am always getting the following error message:
Could not find a part of the path 'C:\Users\xxx\AppData\Local\Temp\Microsoft Dynamics NAV\8636\SomeFile.txt'.

I verified, the file 'C:\Users\xxx\AppData\Local\Temp\Microsoft Dynamics NAV' does not exist.
How shall I proceed?

Comments

  • Johannes_NielsenJohannes_Nielsen Member Posts: 206
    Looks like the path wasn't found or access was not allowed.

    I think it's because the servicetier is executig the code and that local c:\ path isn't found on the server.
    Best regards / Venlig hilsen
    Johannes Sebastian
    MB7-840,MB7-841
Sign In or Register to comment.