File transfer support

Spectrum supports two ways how to transfer files from "legacy network" to XMPP and back.

  • Direct filetransfer
    Files are forwarded directly from "lecagy network"/XMPP to XMPP/"legacy network". However, this has to be supported by "legacy network" and also by XMPP user (more concretely by his/her client). If these conditions are accomplished, this method is used. Otherwise Indirect filetransfer is used.
  • Indirect filetransfer
    Files are received by Spectrum and then the link to the file is sent to XMPP/"legacy network" user. To use this method, you have to have public HTTP server installed.

There are some important variables in configuration file in [service] section which have to be configured:

  • filetransfer_bind_address=IP:port
    This is IP:port couple which is used Spectrum filetransfer server. When there is new file from "legacy network" to be sent to XMPP user, then XMPP user connects to this IP:port and can receive the file. Normally it's your server IP address. You can choose any free port.
  • filetransfer_public_address=IP:port
    This option is useful if you run Spectrum behind the NAT and you have port forwarding configured. When there is new filetransfer request from "legacy network", XMPP client is told to connect this IP:port instead of IP:port configured by filetransfer_bind_address option.
    If this options is not set, filetransfer_bind_address is used as default value.
  • filetransfer_cache=path
    If indirect filetransfer is used, file is stored in this directory and then the link to file is sent to XMPP/"legacy network" user.
  • filetransfer_web=URL
    This is public URL which points to filetransfer_cache directory.

Examples:

# Spectrum will listen on IP 4.2.2.1 on port 12345
filetransfer_bind_address=4.2.2.1:12345

# Indirectly received files will be stored in /var/www/spectrum_files directory.
filetransfer_cache=/var/www/spectrum_files

# /var/www/spectrum_files is accessible via http on URL http://example.com/spectrum_files/
filetransfer_web=http://example.com/spectrum_files/