Tapatalk

Scripting the creation of a FTP connection

Scripting the creation of a FTP connection

2
NewbieNewbie
2

    Sep 05, 2012#1

    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

    6,685587
    Grand MasterGrand Master
    6,685587

      Sep 06, 2012#2

      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.

      262
      MasterMaster
      262

        Sep 06, 2012#3

        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.

        2
        NewbieNewbie
        2

          Sep 06, 2012#4

          Thank you for the prompt replies! I will just have to include instructions for establishing the FTP connection for my co-workers