Scripting the creation of a FTP connection

FTP, SFTP, FTPS, and SSH/telnet console issues

Scripting the creation of a FTP connection

Postby cnessen » Wed Sep 05, 2012 4:47 pm

Is there a way to script creating a new FTP connection? I am attempting to create a script that will:

1) prompt for the hostname of the server
2) prompt for the username and password of the FTP account
3) create and connect to the FTP server using these credentials

I would like to bypass the standard GUI. The hostname and username are also being gathered for others portions of a larger script I am writing.

UltraEdit Professional
Version 18.10.0.1016
cnessen
Newbie
 
Posts: 2
Joined: Thu Aug 30, 2012 12:20 pm

Re: Scripting the creation of a FTP connection

Postby Mofi » Thu Sep 06, 2012 12:36 am

I have not yet tried what happens if you use the command UltraEdit.open("..."); with an FTP file name in a script. All available scripting commands are listed in View - Views/Lists - Tag List in group UE/UES Script Commands and documented on help page with title Scripting commands. There is no command to start an FTP session and I think bypassing the FTP account manager is not possible at all.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4049
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: Scripting the creation of a FTP connection

Postby jorrasdk » Thu Sep 06, 2012 2:18 am

I think it is not possible.

I tried pasting a fully qualified ftp path ( ftp://user:password@host/path/filename ) into the normal Open File dialog and as expected Windows pulled the file from the FTP-server and placed it in the temp folder. And as expected a save file will not put the file back on the FTP server.

Then I tried a small script
UltraEdit.open("ftp://user:password@host/path/filename");
and UE says "... contains an incorrect path"

When I try to use the UE syntax for FTP files but with user/password/host:
UltraEdit.open("FTP::user:password@host\\/path/filename");
it is ignored - no error, and output window says "script succeeded".

So you are stuck with having to create FTP servers and their connection details in the GUI, to be able to open FTP files from script as
UltraEdit.open("FTP::FTPconnectionNameInUE\\/path/filename");

I can see why it sometimes could be handy to open FTP files directly from a script without having to define the connections in the GUI, but it will open up some security issues, as the password will be fully visible for bypassers when it is entered in a UltraEdit.getString box and if working in an non-secure/public environment the password would then be compromised.
User avatar
jorrasdk
Master
Master
 
Posts: 275
Joined: Mon Mar 19, 2007 11:00 pm
Location: Denmark

Re: Scripting the creation of a FTP connection

Postby cnessen » Thu Sep 06, 2012 1:28 pm

Thank you for the prompt replies! I will just have to include instructions for establishing the FTP connection for my co-workers
cnessen
Newbie
 
Posts: 2
Joined: Thu Aug 30, 2012 12:20 pm


Return to FTP/SFTP / SSH/Telnet