Hi!
Well, of course you could use the SHELL command to use som command-line features … but I would recommend CuteFTP …
Because that’s not just a pretty good FTP client for Windows (I don’t think it overkills), but you could also use as Automation Control within NAV without the GUI!!! Here you just could simply use the features you really need. We have quite good experinces with this utility; I don’t share your concerns …
Here the codeunit we use for FTPing with CuteFTP - I think that’s pretty simple:
InitFTP()
CREATE(FTP_Control);
SetRemoteHost(RemoteHost : Text[30])
FTP_Control.Host(RemoteHost);
SetRemotePort(RemotePort : Integer)
FTP_Control.Port(RemotePort);
SetUser(User : Text[30];Password : Text[30])
FTP_Control.Login(User);
FTP_Control.Password(Password);
SetLocalFolder(LocalFolder : Text[250])
FTP_Control.LocalFolder(LocalFolder);
SetRemoteFolder(RemoteFolder : Text[250])
FTP_Control.RemoteFolder(RemoteFolder);
SetLocalFile(LocalFile : Text[250])
FTP_Control.LocalFolder(LocalFile);
SetLocalFilterInclude(LocalFilterInclude : Text[250])
FTP_Control.LocalFilterInclude(LocalFilterInclude);
SetRemoteFilterInclude(RemoteFilterInclude : Text[250])
FTP_Control.RemoteFilterInclude(RemoteFilterInclude);
SetLocalFilterExclude(LocalFilterExclude : Text[250])
FTP_Control.LocalFilterExclude(LocalFilterExclude);
SetRemoteFilterExclude(RemoteFilterExclude : Text[250])
FTP_Control.RemoteFilterExclude(RemoteFilterExclude);
CreateLocalFolder(LocalFolder : Text[250])
FTP_Control.CreateLocalFolder(LocalFolder);
CreateRemoteFolder(RemoteFolder : Text[250])
FTP_Control.CreateRemoteFolder(RemoteFolder);
LocalRename(FromLocalFile : Text[250];ToLocalFile : Text[250])
FTP_Control.LocalRename(FromLocalFile, ToLocalFile);
RemoteRename(FromRemoteFile : Text[250];ToRemoteFile : Text[250])
FTP_Control.RemoteRename(FromRemoteFile, ToRemoteFile);
LocalRemove(LocalFile : Text[250])
FTP_Control.LocalRemove(LocalFile);
RemoteRemove(RemoteFile : Text[250])
FTP_Control.RemoteRemove(RemoteFile);
LocalExists(LocalFile : Text[250]) : Boolean
LocalExists := FTP_Control.LocalExists(LocalFile);
EXIT(LocalExists = -1);
RemoteExists(RemoteFile : Text[250]) : Boolean
RemoteExists := FTP_Control.RemoteExists(RemoteFile);
EXIT(RemoteExists = -1);
Connect()
FTP_Control.Connect();
IsConnected() : Boolean
Connected := FTP_Control.IsConnected();
EXIT(Connected = -1);
Disconnect()
FTP_Control.Disconnect();
Download()
FTP_Control.Download();
Upload()
FTP_Control.Upload();
Close()
FTP_Control.Close();
TestConnection(Host : Text[30];Port : Integer;User : Text[30];Passwd : Text[30])
InitFTP();
Window.OPEN(‘Testing FTP connection …’ +
‘#1############################’);
SetRemoteHost(Host);
SetRemotePort(Port);
SetUser(User, Passwd);
Window.UPDATE(1, STRSUBSTNO(‘Connect to %1:%2 …’, Host, Port));
Connect();
YIELD;
SLEEP(1000);
Successful := IsConnected();
Window.UPDATE(1, STRSUBSTNO(‘Successful: %1’, Successful));
YIELD;
SLEEP(1000);
Window.UPDATE(1, ‘Disconnect …’);
Disconnect();
YIELD;
SLEEP(1000);
Window.CLOSE;
Close();
YIELD;
CLEARALL;
IF Successful THEN
MESSAGE(STRSUBSTNO(‘Could connect to %1:%2’, Host, Port))
ELSE
ERROR(STRSUBSTNO(‘Could not connect to %1:%2’, Host, Port));
Regards,