Options

FTP File Download Using Windows Script

Hi,

I have a code to Upload files to FTP server from my local machine. Can anyone help me ASAP to download the files from FTP to my local system? Dot Net methods are not required since i am doing this for 2009 R1 database.Thanks.

//FTP Upload +++
FTPLocalFolder:= 'Local Folder Path';
FTPFolder:='FTP Folder Path';

FScript.CREATE(FTPLocalFolder + '\script.docx');
FScript.TEXTMODE(TRUE);
FScript.WRITE('FTP User Name');
FScript.WRITE('FTP Password');
FScript.WRITE('binary');
FScript.WRITE('cd ' + FTPFolder);
FScript.WRITE('lcd ' + FTPLocalFolder);
FScript.WRITE('mput ' + '*.xml');
FScript.WRITE('quit');
FScript.CLOSE;


CmdFile.CREATE(LocalFolder + '\upload.cmd');
CmdFile.TEXTMODE(TRUE);
CmdFile.WRITE('ftp -i -s:' + LocalFolder + '\script.docx ' + 'FTP Host');
CmdFile.CLOSE;


IF ISCLEAR(wshshell) THEN
CREATE(wshshell);
WinStyle := 0;
WaitOnReturn := TRUE;
wshshell.Run(LocalFolder + '\upload.cmd',WinStyle,WaitOnReturn);
CLEAR(wshshell);

//FTP Upload ---

Comments

  • Options
    foo_barfoo_bar Member Posts: 91
    edited 2017-07-26
    check mget function
Sign In or Register to comment.