Options

Open File to instream

LgooLgoo Member Posts: 45
edited 2013-11-25 in NAV Three Tier
Hello,

im trying to Open a File to an inStream Variable, but i get the Error that the File dosn't exists.

What is wrong with this Code?
locFileName := locCu_CmnDialogMgt.OpenFileDialog('','','CSV-Dateien (*.csv)|*.csv');
locFile.OPEN(locFileName);
locFile.CREATEINSTREAM(locstream);

Comments

  • Options
    BardurKnudsenBardurKnudsen Member, Microsoft Employee Posts: 137
    Just to be sure:
    Does it fail on the CREATEINSTREAM statement?
    Did you check that the filename exists on the server?
    I would expect your code to open a file dialog on the client machine, returning a file name on the client machine, which you then try to open on the server.
    Bardur Knudsen
    Microsoft - Dynamics NAV
  • Options
    LgooLgoo Member Posts: 45
    It failed on "locFile.OPEN(locFileName);"
    but now i have the solution with UPLOADTOSTREAM ](*,) :D
    [color=#808000]
    UPLOADINTOSTREAM('','','CSV-Dateien (*.csv)|*.csv', locFileName,locstream);[/color]
    
    XMLPORT.FILENAME(locFileName);
    XMLPORT.SETSOURCE(locstream);
    XMLPORT.IMPORTFILE := TRUE;
    
    
Sign In or Register to comment.