Description:

Sends FlowFiles to an FTP Server

Tags:

remote, copy, egress, put, ftp, archive, files

Properties:

In the list below, the names of required properties appear in bold. Any other properties (not in bold) are considered optional. The table also indicates any default values, whether a property supports the Expression Language Guide, and whether a property is considered “sensitive”, meaning that its value will be encrypted. Before entering a value in a sensitive property, ensure that the nifi.properties file has an entry for the property nifi.sensitive.props.key.

Name Default Value Allowable Values Description
Hostname The fully qualified hostname or IP address of the remote system
Supports Expression Language: true
Port 21 The port that the remote system is listening on for file transfers
Username Username
Password Password for the user account
Sensitive Property: true
Remote Path The path on the remote system from which to pull or push files
Supports Expression Language: true
Create Directory false * true
* false
Specifies whether or not the remote directory should be created if it does not exist.
Batch Size 500 The maximum number of FlowFiles to send in a single connection
Connection Timeout 30 sec Amount of time to wait before timing out while creating a connection
Data Timeout 30 sec When transferring a file between the local and remote system, this value specifies how long is allowed to elapse without any data being transferred between systems
Conflict Resolution NONE *REPLACE
*IGNORE
*RENAME
*REJECT
*FAIL
*NONE
Determines how to handle the problem of filename collisions
Dot Rename true * true
* false
If true, then the filename of the sent file is prepended with a "." and then renamed back to the original once the file is completely sent. Otherwise, there is no rename. This property is ignored if the Temporary Filename property is set.
Temporary Filename If set, the filename of the sent file will be equal to the value specified during the transfer and after successful completion will be renamed to the original filename. If this value is set, the Dot Rename property is ignored.
Supports Expression Language: true
Transfer Mode Binary * Binary
* ASCII
The FTP Transfer Mode
Connection Mode Passive * Active
* Passive
The FTP Connection Mode
Reject Zero-Byte Files true * true
* false
Determines whether or not Zero-byte files should be rejected without attempting to transfer
Last Modified Time The lastModifiedTime to assign to the file after transferring it. If not set, the lastModifiedTime will not be changed. Format must be yyyy-MM-dd'T'HH:mm:ssZ. You may also use expression language such as ${file.lastModifiedTime}. If the value is invalid, the processor will not be invalid but will fail to change lastModifiedTime of the file.
Supports Expression Language: true
Permissions The permissions to assign to the file after transferring it. Format must be either UNIX rwxrwxrwx with a - in place of denied permissions (e.g. rw-r--r--) or an octal number (e.g. 644). If not set, the permissions will not be changed. You may also use expression language such as ${file.permissions}. If the value is invalid, the processor will not be invalid but will fail to change permissions of the file.
Supports Expression Language: true
Use Compression false * true
* false
Indicates whether or not ZLIB compression should be used when transferring files
Proxy Type DIRECT * DIRECT
* HTTP
* SOCKS
Proxy type used for file transfers
Proxy Host The fully qualified hostname or IP address of the proxy server
Proxy Port The port of the proxy server
Http Proxy Username Http Proxy Username
Http Proxy Password Http Proxy Password
Sensitive Property: true

Dynamic Properties:

Dynamic Properties allow the user to specify both the name and value of a property.

Name Value Description
pre.cmd._____ Not used The command specified in the key will be executed before doing a put. You may add these optional properties to send any commands to the FTP server before the file is actually transferred (before the put command). This option is only available for the PutFTP processor, as only FTP has this functionality. This is essentially the same as sending quote commands to an FTP server from the command line. While this is the same as sending a quote command, it is very important that you leave off the .
post.cmd._____ Not used The command specified in the key will be executed after doing a put. You may add these optional properties to send any commands to the FTP server before the file is actually transferred (before the put command). This option is only available for the PutFTP processor, as only FTP has this functionality. This is essentially the same as sending quote commands to an FTP server from the command line. While this is the same as sending a quote command, it is very important that you leave off the .

Relationships:

Name Description
failure FlowFiles that failed to send to the remote system; failure is usually looped back to this processor
reject FlowFiles that were rejected by the destination system
success FlowFiles that are successfully sent will be routed to success

Reads Attributes:

None specified.

Writes Attributes:

None specified.

How to configure?

Step 1: Drag and drop the PutFTP processor to canvas.

Step 2: Double click the processor to configure. The configuration dialog will be opened as follows:

properties

Step 3: Check the usage of each property and update those values.

Properties and usage

Hostname: Specifies the hostname or IP address of the FTP (File Transfer Protocol) server.

Port: Specifies the FTP server port number. By default, it is 21.

Username:** Specifies the username.

Password: Used to specify password for the user account.

Remote Path: Specifies the path on the remote system from which to pull or push files.

Create Directory: Used to create directory if it does not exist.

Batch Size: Specifies the maximum number of files to send in a single connection.

Connection Timeout: Specifies the amount of time to wait while creating a connection.

Data Timeout: Used to specify how long you can wait without any data being transferred between systems when transferring a file between the local and remote system.

Conflict Resolution: Specifies how to handle the problem of filename collisions.

  • Replace
  • Ignore
  • Rename
  • Reject
  • Fail
  • None

Dot Rename: If it is true, then the filename of the sent file is prepended with a “.” and then renamed back to the original once the file is completely sent. Otherwise, there is no rename. This property is ignored if the temporary filename property is set.

  • true
  • false

Temporary Filename: It is used to set this as a filename while transferring and then rename back to the original once the file is completely sent. This property is ignored if the temporary filename property is set.

Transfer Mode: Specifies the transfer mode for the FTP server, the following are the transfer modes:

  • Binary
  • ASCII

Connection Mode: Used to specify the connection mode for the FTP server, the following are the connection modes:

  • Active
  • Passive

Reject Zero-Byte Files: Used to specify Zero-byte files should be rejected without attempting to transfer.

  • true
  • false

Last Modified Time: Specifies the lastModifiedTime to assign to the file after transferring it. If not set, the lastModifiedTime will not be changed. Format must be yyyy-MM-dd’T’HH:mm:ssZ.

Permissions: Used to assign permissions to the file after transferring it. Format must be either UNIX rwxrwxrwx with a - in place of denied permissions (e.g. rw-r–r–) or an octal number (e.g. 644). If not set, the permissions will not be changed.

Use Compression: Used to specify if ZLIB compression should be used when transferring files.

Proxy Type: Specifies proxy type used for file transfers.

  • Direct
  • Http
  • Socks

Proxy Host: Used to specify the fully qualified hostname or IP address of the proxy server.

Proxy Port: Used to specify the port number of the proxy server.

Http Proxy Username: Used to specify the http proxy username.

Http Proxy Password: Used to specify the http proxy password.

Internal Buffer Size: Used to set the internal buffer size for buffered data streams.

Use UTF-8 Encoding: Used to specify the client to use UTF-8 encoding when processing files and filenames. If set to true, the server must also support UTF-8 encoding.

  • true
  • false

For example, to retrieve sample.csv file from temp directory from the serverftp://172.217.3.14, then configuration should be as follows:

sample

sample

See Also:

GetFTP