OS4X plugin os4xplugin ftp upload

From OS4X
Jump to navigation Jump to search

Purpose

For simple FTP upload tasks, this plugin can transfer all job files to a target FTP server

Configuration

The plugin must be configured on per-partner level and has no global configuration.

Configuration parameters are:

  • Server: server incl. protocol being used. Supported protocols are (at least, but not limited to) "ftp".
  • Path: target path where to upload files to.
    • Syntax: /<pathToUpload>
    • Example: /upload
    • Missing leading slashes will be appended automatically, but you should configure this.
    • Trailing slashes will be removed automatically, but you should not configure these.
  • (optionally) Username: The username used for login to the server.
  • (optionally) Password: The password used for login to the server.
  • (optionally) Verbose output: all protocol specific communication (incoming and outgoing) will be logged.
  • (optionally) Disable proxy: no proxy will be used, even is there is one configured elsewhere in the system.
  • (optionally) Force HTTP 1.0 for proxy communication: Bugfix for several proxy systems which support HTTP 1.0 (i.e. for FTP transfers), but don't support the default HTTP 1.1 behaviour.

Since OS4X 3 Build 20191106, the target directory may contain variables, which are resolved at runtime of the plugin. The list of usable variables is:

  • %j: job number
  • %d: day of job creation (two digits)
  • %m: month of job creation (two digits)
  • %Y: year of job creation (four digits)
  • %H: hour of job creation (two digits, 24h format)
  • %M: minute of job creation (two digits)
  • %S: second of job creation (two digits)
  • %D: job direction (either "incoming" or "outgoing")
  • %r: recipient partner shortname
  • %s: sender partner shortname
  • %t: recipient location
  • %u: recipient department
  • %v: recipient name
  • %w: recipient last name
  • %x: recipient address code
  • %g: sender location
  • %h: sender department
  • %i: sender name
  • %J: sender last name
  • %k: sender address code
  • %e: depending on the job direction, the partner shortname of the external communication partner
    • for incoming jobs: sender partner shortname (see "%s")
    • job outgoing (or undefined job directions): recipient partner shortname (see "%r")
  • %a: ENGDAT Message Reference [UNH0062] (if given, otherwise empty)
  • %b: ENGDAT Document Number [MID1004] (if given, otherwise empty)
  • %p: sender partner's event parameter
  • %P: recipient partner's event parameter
  • %Q: depending on the job direction, the event parameter of the external communication partner:
    • incoming jobs: sender's event parameter (= "%p")
    • outgoing jobs or undefined job direction: recipient's company shortname (= "%P")

Since OS4X release 2021-06-15, the following variable exists:

  • %A: year of job creation (last two digits)

Starting with OS4X release 2021-06-15, the following variable is also available:

  • %A: job year (short, two digits)

Since OS4X 3 Build 20211130 the following variable is available:

  • %%: represents the character "%"

Behaviour

The plugin loops over all files of the job and handles them separately (one after another). For each file, the plugin

  • connects to the FTP server
  • uploads the file to the target directory with the temporary name with a leading dot (".") in front of the virtual filename
  • after upload, the file is being renamed to the virtual filename without the leading dot.

Since the plugin has no specific configuration for proxies, the plugin uses the system-wide proxy settings of your system (see OS4X HTTP Proxy support), if a HTTP target is being adressed.

When using a FTP proxy, you have to define an environment variable, either:

  • ftp_proxy
  • all_proxy

The syntax of these environment variables is the same as the one for HTTP (described here).

Protocol support

The plugin is compiled with the following contained protocols. For details, please refer to the CURL library:

  • DICT
  • FILE
  • FTP
  • FTPS
  • GOPHER
  • HTTP
  • HTTPS
  • IMAP
  • IMAPS
  • POP3
  • POP3S
  • RTSP
  • SCP
  • SFTP
  • SMB
  • SMBS
  • SMTP
  • SMTPS
  • TELNET
  • TFTP