Chapter 3 - FTP Commands
List of Commands
F T P A d a p t e r R e f e r e n c e G u i d e
2 3
Make Directory (-MKD)
Use the Make Directory adapter command (-
MKD
) to create a directory. For
example, if a file specified in a
PUT
operation belongs in a directory that does not
exist, the
–MKD
command creates the new directory.
If the
–MKD
command is not specified and the file specified on a
PUT
operation
points to a directory that does not exist, the adapter will fail.
This is an optional command.
-MKD
For example:
PUT(“FTP”, “-URL ftp://jdoe:secret@server1/some/folder/data.txt
-MKD”, “Some data”)
will force
jdoe/some
and then the
jdoe/some/folder
to be created. A new file
called
data.txt
will be added to this new directory.
Passive Mode (-PV or -PASV)
The Passive Mode adapter command (
-PV
or
-PASV
) specifies that you only try
passive mode for the FTP data connection. Passive mode is primarily useful for
firewalls and is a preferred connection method for security reasons.
By default, the adapter attempts to connect using passive mode. If unsuccessful,
the adapter uses Port Mode; see the Port Mode adapter command (
-PT
). During a
passive mode connection, the server listens for the connection and dictates where
the adapter is to connect.
-PASV
Note
Older servers might not support passive mode.
Port Mode (-PT or -PORT)
The Port Mode adapter command (
-PT
or
-PORT
) specifies that you only try port
mode for the FTP data connection. This is an older connection method and may be
the only way to connect on older servers.