Overview
The SFTP Task is an SSIS Control Flow task for remote file transfer and management.
Parameters
General
Use the General page of the SFTP Task Editor dialog to configure the parameters needed to send or receive files and to manage directories and files.
Specify the task name.
Specify the task description.
Specify whether or not the SFTP Task terminates if the command fails.
Specify the task action. This parameter has the options listed in the following table.
Option Description Send files Sends files. Selecting this action displays the dynamic parameters IsLocalVariable, Local, LocalVariable, IsLocalFilterVariable 1.5 SR-2, LocalFilter 1.5 SR-2, LocalFilterVariable 1.5 SR-2, Connection, IsRemoteVariable, Remote, RemoteVariable, OverwriteRemote.
Starting from 1.3 SR-3 You can enter multiple local specifications, each one separated with a vertical bar (|).Receive files Receives files. Selecting this action displays the dynamic parameters IsLocalVariable, Local, LocalVariable, OverwriteLocal, Connection, IsRemoteVariable, Remote, RemoteVariable, IncludeSubfolders 1.5, IsRemoteFilterVariable 1.5, RemoteFilter 1.5, RemoteFilterVariable 1.5. Create remote directory Creates a remote directory. Selecting this action displays the dynamic parameters Connection, IsRemoteVariable, Remote, RemoteVariable. Remove remote directory Removes a remote directory. Selecting this action displays the dynamic parameters Connection, IsRemoteVariable, Remote, RemoteVariable. Delete remote files Deletes remote files. Selecting this action displays the dynamic parameters Connection, IsRemoteVariable, Remote, RemoteVariable, IncludeSubfolders 1.5, IsRemoteFilterVariable 1.5, RemoteFilter 1.5, RemoteFilterVariable 1.5. Rename remote file Renames a remote file. Selecting this action displays the dynamic parameters Connection, IsOldNameVariable, OldName, OldNameVariable, IsNewNameVariable, NewName, NewNameVariable. Get remote files list 1.2 SR-1 Gets a list of remote files. Selecting this action displays the dynamic parameters ResultVariable, Connection, IsRemoteVariable, Remote, RemoteVariable, IncludeSubfolders 1.5, IsRemoteFilterVariable 1.5, RemoteFilter 1.5, RemoteFilterVariable 1.5. Indicate whether or not the local path is stored in a variable. This parameter has the options listed in the following table.
Options Description True The local path is stored in a variable. Selecting this option displays the dynamic parameter LocalVariable. False The local path is specified in a File connection manager. Selecting this option displays the dynamic parameter Local. Select an existing File connection manager, or click <New connection...> to create a new connection manager.
Related topics: File Connection Manager Editor
Select an existing user-defined variable, or click <New variable...> to create a new variable.
Related Topics: Integration Services Variables, Add Variable
Indicate whether or not the local filter is stored in a variable. This parameter has the options listed in the following table.
Options Description True The local filter is stored in a variable. Selecting this option displays the dynamic parameter LocalFilterVariable. False The local filter is explicitly specified. Selecting this option displays the dynamic parameter LocalFilter. Use this parameter to specify filter criteria for local files. The criteria is specified using a FLEE expression. You can use the following elements from the System.IO FileInfo class: CreationTime, Directory, DirectoryName, Extension, FullName, IsReadOnly, LastAccessTime, LastWriteTime, Length, and Name. The following additional .NET Framework elements can also be used in FLEE expressions for filtering: DateTime, Now and Regex.
An example of an expression that can be used to get all zip files from the past 5 days is as follows: Modifiedtime > Now.AddDays(-5) and Name.EndsWith(".zip")
Select an existing user-defined variable, or click <New variable...> to create a new variable.
Related Topics: Integration Services Variables, Add Variable
Select an existing connection manager, or click <New connection...> to create a new connection manager.
Related Topics: FTPS Connection Manager 1.5, SSH Connection Manager
Indicate whether or not the remote path is stored in a variable. This parameter has the options listed in the following table.
Options Description True The remote path is stored in a variable. Selecting this option displays the dynamic parameter RemoteVariable. False The remote path is explicitly specified on the remote server. Selecting this option displays the dynamic parameter Remote. Select remote path on the remote server.
Select an existing user-defined variable, or click <New variable...> to create a new variable. Starting from 1.3 SR-3 you can enter an array of items for a remote parameter (string or IFileInfo). The variable type must be Object.
Related Topics: Integration Services Variables, Add Variable
Specify whether or not a remote file can be overwritten.
If you are sending 0-length files, make sure this option is set to True. Otherwise the remote file will not be created.Specify whether or not the local file can be overwritten.
Indicate whether or not the old name is stored in a variable. This property has the options listed in the following table.
Options Description True The old name is stored in a variable. Selecting this option displays the dynamic parameter OldNameVariable. False The old name is specified in a File connection manager. Selecting this option displays the dynamic parameter OldName. Select an existing File connection manager, or click <New connection...> to create a new connection manager.
Related topics: File Connection Manager
Select an existing user-defined variable, or click <New variable...> to create a new variable.
Related Topics: Integration Services Variables, Add Variable
Indicate whether or not the new name is stored in a variable. This parameter has the options listed in the following table.
Options Description True The new name is stored in a variable. Selecting this option displays the dynamic parameter NewNameVariable. False The new name is specified in a File connection manager. Selecting this option displays the dynamic parameter NewName. Select an existing File connection manager, or click <New connection...> to create a new connection manager.
Related topics: File Connection Manager
Select an existing user-defined variable, or click <New variable...> to create a new variable.
Related Topics: Integration Services Variables, Add Variable
Select an existing user-defined variable, or click <New variable...> to create a new variable. Also check the ExtendedRemoteFileInfo parameter below.
Related Topics: Integration Services Variables, Add Variable
Indicate whether or not ResultVariable contains a string of remote file names or array of extended file information. This parameter has the options listed in the following table.
Options Description True The ResultVariable contains an array of IFileInfo interface objects. False The ResultVariable contains an string of remote file names separated with a newline (\n) character. Not visible in the task user interface.Check the following script showing how to access ExtendedRemoteFileInfo ResultVariable (you must reference the CozyRoc.SSIS library in your script project):
Indicate whether or not the remote path is a wildcard. This property has the options listed in the following table.
Options Description True The remote path is a wildcard. False The remote path is an explicit specification. Not visible in the task user interface.Specify if the task should fail when the specified remote files don't exist. This parameter has the options listed in the following table.
Options Description True The task fails if the specified remote files don't exist. False The task ignores and completes successfully if the specified remote files don't exist. Not visible in the task user interface.Specify if remote files are recursively included. This parameter has the options listed in the following table.
Options Description True The task includes all remote files recursively, starting from the specified remote path. False The task includes only the specified remote path files. This is the default option. Indicate whether or not the remote filter is stored in a variable. This parameter has the options listed in the following table.
Options Description True The remote filter is stored in a variable. Selecting this option displays the dynamic parameter RemoteFilterVariable. False The remote filter is explicitly specified. Selecting this option displays the dynamic parameter RemoteFilter. Use this parameter to specify filter criteria for remote files. The criteria is specified using a FLEE expression. You can use the following elements from the IFileInfo interface: Name, FullName, Size, ModifiedTime, and IsDirectory. The following additional .NET Framework elements can also be used in FLEE expressions for filtering: DateTime, Now and Regex.
An example of an expression that can be used to get all zip files from the past 5 days is as follows: Modifiedtime > Now.AddDays(-5) and Name.EndsWith(".zip")
Select an existing user-defined variable, or click <New variable...> to create a new variable.
Related Topics: Integration Services Variables, Add Variable
Specify remote path separator. The default separator is a forward slash (/).
Knowledge Base
- Where can I find the documentation for the SFTP Task?
- When using the SFTP Task how can I prevent the connection from closing
- I recently upgraded to a new release of SSIS+ and noticed that the SFTP Task has been deprecated. Will my existing packages that use the SFTP Task still work with the new SSIS+ release?
- SFTP Task Error: Authentication was partially successful, but server requires additional authentication with: 'password,keyboard-interactive'. (Rebex.Networking)
- Error Message: no such file: no such file
Related scripts
Samples
What's New
- Deprecated: Replaced by File Transfer Task.
- Fixed: Failed when change remote directory command was disabled on server. Implemented change remote directory command not to be executed when Remote parameter is not specified.
- Fixed: Failed with error "System.OverflowException: Arithmetic operation resulted in an overflow" when trying to process Filter expression containing time span (Thank you, Julian).
- Fixed: Task incorrectly cut the first characters of downloaded file name in certain cases.
- New: A new parameter RemotePathSeparator to set the used remote path separator character.
- New: Task now reports bytes transferred, when sending/receiving files (Thank you, John).
- New: A new parameter LocalFilter to set local file filter expression when using 'Send files' action.
- New: Support for moving of multiple files, when using 'Rename remote file' action (Thank you, Richard).
- Fixed: Task will now return error, when there are no remote files to receive or remove. This matches the behavior of the standard FTP task.
- Fixed: Failed to process correctly wildcard specified source.
- New: Included support for processing multiple source wildcard file specifications. Each specification is separated with vertical bar (|).
- Fixed: Task will now return error, when there are no files to send. This matches the behavior of the standard FTP task.
- New: Included support for processing multiple items (string or IFileInfo) for Remote parameter, when using 'Receive files', 'Delete remote files', 'Get remote files list' actions. The Remote parameter has to be variable of type Object.
- New: Introduced task.
Related documentation
COZYROC SSIS+ Components Suite is free for testing in your development environment.
A licensed version can be deployed on-premises, on Azure-SSIS IR and on COZYROC Cloud.