Post login commands

From FileZilla Wiki
Jump to: navigation, search

Some outdated servers default to legacy file systems not supported by modern FTP clients such as FileZilla. Modern FTP software implements TVFS as defined by RFC 3659 instead.

When the FTP server on such a legacy platform has it's default set to use a filesystem unsupported by FileZilla, then you may require some custom commands to be issued to tell the FTP server to expect a more modern Unix/Linux or Windows file system syntax, so that the FileZilla client can successfully connect and communicate with the FTP server. Manually entering these commands does not work as: a) they do not apply to the transfer connections which are separate from the browsing connection b) and/or by then the FileZilla client already issued the initial handshaking commands and had failed to obtain a successful directory and file listing. As a result the FileZilla client disables the server navigation pane.

A good example of a modern and mainstream platform where this applies, is the IBM i operating system that is very popular with banks and businesses due to it's very secure and advanced object based architecture. Because of it's scalability and legendary reliably and stability, and because it can run for months and years with no or little supervision, many large companies have literally many thousands of these IBM i servers installed across head- and branch offices with only a few employees being any the wiser or aware of their existence. Unfortunately, the IBM i's "do the job with no fuss" and self-managing, self-healing attributes also removes it from the daily limelight of more troublesome and labor intensive platforms. This, coupled with it's server-only personality (inability to be used as a GUI client platform), causes it to be unfairly perceived by many as obscure and legacy, which in turn results in lack of proper support for the platform by uninformed Unix/Linux/Windows-centric software developers. For example, FileZilla could very easily provide native support for this platform by simply adding IBM i to the Server Type drop down list on the Advanced tab of Site Manager, and by issuing the following two commands directly after log-on: SITE NAMEFMT 1 and SITE LISTFMT 1. It would make life a lot easier for thousands of frustrated IBM i end-users where changing the FTP server defaults is impractical because it will most certainly break some existing applications. In the meantime use the IBM i specific work around shown below:

Workaround: Use the post-login command feature of the site-manager as follows: - Add a new site-manager entry and close FileZilla. - Next open sitemanager.xml in the settings directory of FileZilla and add a PostLoginCommands element inside the Server element. - Inside PostLoginCommand, use the Command element, with the actual command to execute as text.

General example:

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<FileZilla3>
    <Servers>
        <Server>
            <Host>127.0.0.1</Host>
            <Port>21</Port>
            <PostLoginCommands>
              <Command>VALID FTP COMMAND 1</Command>
              <Command>VALID FTP COMMAND n</Command>
            </PostLoginCommands>
        </Server>
    </Servers>
</FileZilla3>

Example for a non-secure connection to IBM i, i5/OS, OS/400, AS/400 and iSeries (works regardless of FTP server default settings for NAMEFMT, CURDIR and LISTFMT):

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<FileZilla3>
    <Servers>
       <Server>
           <Host>system_name</Host>
           <Port>21</Port>
           <Protocol>0</Protocol>
           <Type>0</Type>
           <User>user_profile</User>
           <Logontype>2</Logontype>
           <TimezoneOffset>0</TimezoneOffset>
           <PasvMode>MODE_DEFAULT</PasvMode>
           <MaximumMultipleConnections>0</MaximumMultipleConnections>
           <EncodingType>Auto</EncodingType>
           <PostLoginCommands>
               <Command>SITE NAMEFMT 1</Command>
               <Command>SITE LISTFMT 1</Command>
           </PostLoginCommands>
           <BypassProxy>0</BypassProxy>
           <Name>system_name</Name>
           <Comments></Comments>
           <LocalDir></LocalDir>
           <RemoteDir></RemoteDir>
           <SyncBrowsing>0</SyncBrowsing>system_name
       </Server>     
   </Servers>
</FileZilla3>

NOTES:

1. If connecting using this site-manager entry, these commands get executed in the transfer connections as well.

2. itemanager.xml file is located in %APPDATA%/FileZilla on Windows 7.

3. On Apple Mac OS X the file is located in /Users/user-name/.filezilla/sitemanager.xml