Transfer Files

This node copies or moves files from a source (folder or file) to another folder. The node offers options to either copy or move a single file, a complete folder or the files in a selected folder, with the option to include subfolders, to a specified folder. If the "Delete source files (move)" option is checked the node performs a move operation for which the source files will be deleted after the copying process is done.

This node can access a variety of different file systems. More information about file handling in KNIME can be found in the official File Handling Guide.

Options

Read from
Select a file system which stores the files/folders you want to copy/move. There are four default file system options to choose from:
  • Local File System: Allows you to select a file/folder from your local system.
  • Mountpoint: Allows you to read from a mountpoint.When selected, a new drop-down menu appears to choose the mountpoint. Unconnected mountpoints are greyed out but can still be selected (note that browsing is disabled in this case). Go to the KNIME Explorer and connect to the mountpoint to enable browsing. A mountpoint is displayed in red if it was previously selected but is no longer available. You won't be able to save the dialog as long as you don't select a valid i.e. known mountpoint.
  • Relative to: Allows you to choose whether to resolve the path relative to the current mountpoint, current workflow or the current workflow's data area. When selected a new drop-down menu appears to choose which of the three options to use.
  • Custom/KNIME URL: Allows to specify a URL (e.g. file://, http:// or knime://protocol). When selected, a spinner appears that allows you to specify the desired connection and read timeout in milliseconds. In case it takes longer to connect to the host / read the file, the node fails to execute.Browsing is disabled for this option.
To copy/move a file/folder from other file systems, click on ... in the bottom left corner of the node icon followed by Source File System Connection. Afterwards, connect the desired file system connector node to the newly added input port. The file system connection will then be shown in the drop-down menu. It is greyed out if the file system is not connected in which case you have to (re)execute the connector node first. Note: The default file systems listed above can't be selected if a file system is provided via the input port
The location can be exposed as or automatically set via a path flow variable..
Mode
There are three different file/folder modes available:
  • File: Copies a single file.
  • Folder: Copies a single folder with all its files and the underlying folder structure.
  • Files in folder: Copies the files in a folder and creates the necessary folder structure as in the source folder.
Filter options
Only displayed if the mode Files in folder is selected. Allows to specify which files should be included according to their file extension and/or name.It is also possible to include hidden files. The folder filter options enable you to specify which folders should be included based on their name and hidden status. Note that only folders in the file paths of the selected files will be copied.
Include subfolders
If this option is checked, the node will include all files from subfolders that satisfy the specified filter options. If left unchecked, only the files in the selected folder will be included and all files from subfolders are ignored.
Write to
This option allows you to specify a folder where you want to copy your file, files or folder in the end. This option has got the same options, except for the custom URL option, as the Read from option with regards to the file system options.
The location can be exposed as or automatically set via a path flow variable.
Create missing folders
Select if the folders of the selected output location should be created if they do not already exist. If this option is unchecked, the node will fail if a folder does not exist.
Destination file path
Depending on the selected mode the location of the files/folders to be copied to the destination folder will differ.
  • Include only the selected file/folder: This mode ensures that the selected file/folder is directly copied into the destination folder.
  • Include all folders in the source path: This mode ensures that the folder containing the selected source file/folder will also be created inside the destination folder, i.e., if the source is src_folder/src_subfolder and the destination is dest_folder the content of the source is copied to dest_folder/src_folder/src_subfolder.
  • Include all folders in the source path succeeding the prefix: This mode behaves similar to the Include all folders in the source path option, except that the specified folder prefix (the beginning of the path) is being ignored, e.g., if the specified prefix is src_folder the source path is src_folder/src_subfolder, the source is copied to dest_folder/src_subfolder. Note: In special cases using this option can try to copy the source file/folder to a location that is outside the specified destination. In this case the node will fail.
Transfer policy
  • Overwrite: Will replace any existing file.
  • Overwrite if newer: Will replace any existing file if the source file's last modified date is after the destination file's last modified date, otherwise the file will not be overwritten and the copy process is being continued.
  • Ignore: Will ignore if a file already exists and continues the copying process.
  • Fail: Will issue an error during the node's execution (to prevent unintentional overwrite).
Delete source files / folders
If this option is checked all files which have been successfully copied to the destination folder will be deleted in the source folder. The output contains an additional column indicating if the file has been deleted (true) or not (false).
Fail on unsuccessful deletion
If the 'Delete source files (move)' option is activated and something goes wrong during the deletion process the node will fail. This option is only available if the before mentioned option is selected.
Detailed output
If selected the output will not only show the folder that has been copied/moved but also all the files/folders it contains.

Input Ports

Icon
The source file system connection.
Icon
The destination file system connection.

Output Ports

Icon
The files which should be copied with a source path column, destination path column, a folder identifier column, a copy status column and a deleted source column.

Popular Successors

Views

This node has no views

Workflows

Links

Developers

You want to see the source code for this node? Click the following button and we’ll use our super-powers to find it for you.