Ftp

maikeljmaikelj Member Posts: 50
edited 2003-04-10 in Navision Attain
Hello everybody,

I want to send a document via standard FTP (Win98,WinXP) to a printer.

Question 1: Is it possible?
Question 2: If so, how?

I only tried using code with a "SHELL" command.
But this doesn't work.

MaikelJ

Comments

  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • maikeljmaikelj Member Posts: 50
    I already found a solution (see below):

    FtpUser[1] := 13; // Global var. text
    FtpPw[1] := 13; // Global var. text
    //Create FTP Script 
    FtpScript.CREATE('D:\script.txt');
    FtpScript.TEXTMODE(TRUE); 
    FtpScript.WRITE(FtpUser); //Variables with USERID 
    FtpScript.WRITE(FtpPw); //Variable with FTP PW 
    FtpScript.WRITE('binary'); 
    FtpScript.WRITE('Put d:\test.txt 172.16.155.143'); // Print test.txt to a IP address from a printer
    FtpScript.WRITE('quit'); 
    FtpScript.CLOSE; 
    
    //Exec FTP Transfer 
    SHELL('ftp','-s:D:\script.txt','172.16.155.143');
    
    //Clear Folder
    //Clear Script because readable password!! 
    IF EXISTS('D:\script.txt') THEN
      FILE.ERASE('D:\script.txt');
    

    Maybe someone else needs it :lol:

    MaikelJ

    ps. This message should be in the Financials forum, sorry :oops:
  • maikeljmaikelj Member Posts: 50
    I already found it.

    Thanks anyway Luc.
Sign In or Register to comment.