FTP In

<< Click to Display Table of Contents >>

Navigation:  Nodes > Input > Downloads >

FTP In

 

 

Purpose

 

This node allows you to download files from an FTP server.

An easy way to configure the authentication credentials is to store them in the Workflows -> Workflows Credentials Manager, which permits to store credentials and re-utilize them later by simply selecting their name in the node contextual menu (right click on the node) -> Credentials list.

 

Outputs

 

To: Downloaded files are sent through this connector.

 

 

Standard properties

Object Name

Color

Bypass

Lock

 

Folder properties

Include

Exclude

 

Python standard properties

code

This node is written in Python, and the source code is provided for additional flexibility.

 

Node specific properties

 

URL: It is the server URL address and it must contain the complete path, including folders and subfolders where the content to download is located.

 

Example: ftp://hostname/folder1/folder2/filename.ext  (where hostname is the server)

 

 

Local Path: Folder path destination to store donwloaded files.   Make sure to end the path with the typical folder slash "/".

 

New Files Only: Do not download existing files in the Local Path folder.

 

Skip Orphan Sidecars: Do not upload standalone sidecar files. This happens when there is a sidecar file without the corresponding media file that it relates to. For example an .md5 checksum file, or .xmp,or .csv metadata file, etc without their corresponding media companion. These situations can happen for multiple reasons, like users deleting media files without noticing their sidecar files, or incomplete move/delete/upload processes, software crashes,  and so on. Activating this property can be recommended because those situations are undesired and can create software inconsistencies, but sometimes there can be false positives (mainly due to the lack of proper standards). For example, .csv files are sometimes used as sidecar files (one .csv per media file) but other times there is just one .csv with valid metadata for the whole sequence. If that is your case you can deactivate this setting to avoid ignoring those files during the upload.

 

 

Delete after transfer: Delete the original files from the ftp server after downloading them (to effectively "move" the files rather than making copies)

 

CONFIG:

 

Protocol: Permits to choose between ftp and sftp protocols.

 

Port: Network port that will be used for the FTP communication. It will usually be port 21.

 

Retries: Maximum number of reconnection attempts. This is specially useful to avoid unattended workflows (such as those triggered by the Watcher or Auto trigger nodes) being stuck forever while trying to connect to non responsive servers.

 

Auth Type: You can choose the Authentication type between password, private key and public key. If you choose public or private key, new properties SSH Key File and Key pass phrase will appear, asking for the SSH certificate or the key pass phrase.

 

User: User to login to the server.

 

Password: Password to login  to the server.

 

PYTHON:

 

Ptyhon -> Aux Code: This property is for python programmers. Permits to rename the files being transferred by using a user defined python function. To use it you need to define a python function named translateFinalFilePath(self,filePath), and it will be called with  the original filename passed as filePath (a string parameter). Then the function needs to return a string with the new filename.

 

Example 1: This example will rename the files to use the first 8 characters only.

 

import os

def translateFinalFilePath(self, filePath):

   basePath, fileName = os.path.split(filePath)

   name, ext = os.path.splitext(fileName)

 

   shortName = name[:8]  # shortName with 8 characters only

   newFileName = shortName + ext

 

   return os.path.join(basePath, newFileName)

 

Example 2: You have a full python context, so you can also import modules, add additional functions, etc. This example will rename all files ending in .ts, .srt, or .stl extensions.  For those files, it will search the original name for a <mediaID> tag matching some conditions, and if it is found it will use the next 8 characters as the new filename (plus the original extension).

 

import os

import re

 

def findMediaID(name):

 rx='(?P<mediaID>[6-9][AWMB][JT]d{5})'

 res=re.search(rx,name)

 if res:

   return res.start()

 else:

   return 0

 

def translateFinalFilePath(self,filePath):

 p=os.path.dirname(filePath)

 n=os.path.basename(filePath)

 n,ext=os.path.splitext(n)

 ext=ext.lower()

 if ext=='.ts' or ext== '.srt' or ext=='.stl':

   pos=findMediaID(n)

   res= '{}/{}{}'.format(p,n[pos:pos+8],ext)

   self.info('ftp:rename','FTP: New Dst FilePath={}'.format(res))

 else:

   res=filePath

 return res

 

 

 

 

 

Developer reference (API Rest - node/FTPIn/property/[Property ID])

 

Property Label

Property ID

URL

url

Local Path

localPath

New Files Only

newFilesOnly

Skip Orphan Sidecars

ignoreStandAloneSidecars

Rename Files List

renameFilesList

Delete After Transfer

deleteAfterTransfer

Are You Sure?

areYouSure

Include

include

Exclude

exclude

Protocol

protocol

Port

port

Retries

retries

Auth. Type

authType

User

user

Password

pwd

SSH Key File

keyFile

Key Pass Phrase

keyPassPhrase

Aux Code

auxCode