In a previous post, I explained why PASV mode is the preferred method to connect to an FTP server. That is all well and good, but how do you actually USE PASV mode?

The FTP client that ships with Windows does not support PASV mode. Google will tell you that it does, by using the raw command. However, this is not true, you cannot perform PASV connections using the Windows FTP client. It can only do active connections. So if you are behind a firewall that does not allow this, how do you do command line FTP?

Command line FTP is useful for scheduled operations often performed from a script. On Windows, this might be a batch file executed by the Windows Task Scheduler. Well, if you wish to automate a file transfer in this way, you will almost certainly have to download a third party FTP client that supports PASV data channels.

One FTP client that is available for this task is ncFTP. For uploading or downloading a file inside a script, you can use the ncftpget and ncftpput programs respectively.

For example, to download a file from an FTP server using PASV mode, you can use ncftpget with the following options.

ncftpget -F -u <username> -p <password> <site name> /path/to/remote C:pathtolocal

P.S. Here’s a printer friendly list of FTP server commands and a here’s how FTP server commands work.

Related Posts

Related Topics & Tags: General Information

About Brian Dowden

I am the Director of Client Services at SmartFile. My job is to make sure customers are happy with the SmartFile Web App and continue to use it. I am also responsible for being awesome 100% of the time. So far my record is flawless.

Leave a Reply

Your email address will not be published. Required fields are marked *