FTP Uploader Windows Console Application

This simple console application takes one or more files and uploads them to specified FTP server. It may read files in directory by mask, or process just one file.

System requirements: .NET Framework 4.6 (so, Windows Vista and up)

No installation required, just run the app from command line prompt or batch file.

It was designed mainly for batch files, including ones that are scheduled to run in unattended mode, so it supports verbose mode (when it shows every messages worth showing) by switch, and writes errors / warnings to Windows Event Log.

Syntax:
ftpu.exe [file or directory] /mask:*.txt /retry:10 /retrysec:180 /passive /login:[login] /pwd:[password] /host:[ftp server name or IP] /port:[ftp server port] /delete /move:[directory] /keepalive /textmode /buffer:4096

Command line parameters:

[file or directory] - full path to either file or directory that needs to be sent to FTP server. Utility doesn't replicate directory structure and will only upload files from directory itself, without sub-directories. This has to be the very first parameter.

/mask - if 1st parameter is directory, select files by this file mask. e.g. *.csv. This is optional parameter, default is "*", which takes all files.
/retry - how many times to retry, if there is connection / transfer problem. Optional, default is 3
/retrysec - wait this number of seconds between retries. Optional, default is 180 (3 minutes)
/passive - use passive FTP connection (port 21 only, no data port 20).
/delete - delete file after successful transfer
/move - once file is successfully processed, move it to specified directory
- if both move and delete specified, file will be deleted.
/buffer - buffer, in bytes. Default is 4K. You can write 4 kilobytes as either 4096 or 4k. 32 kilobytes would be 32k. Faster connections may benefit from larger buffer.

Parameters not related to FTP:

/v - Verbose mode. Print informational messages.
/q - Quiet mode. All messages will be printed to Event Log only.
/log - Prepare Event Log. This should be normally used just once, using Run As Administrator.
/y - Disable prompts (active by default with /q switch)

Example:

ftpu.exe c:\temp\myfiles /mask:*.csv /passive /host:ftp.example.com /delete /keepalive /textmode

Application will look for files with file extension “csv” in directory “c:\temp\myfiles”, and if any are found, they will be uploaded to root directory of ftp.example.com, and after successful download local files will be deleted. Connection will be kept alive between requests, will only use port 21 and files will be transferred in text mode.

Download binaries for Windows

ftpu.zip (15.72 kb)

blog comments powered by Disqus