# FTP / SFTP / FTPS

MFN support transfer of news by uploading files to a FTP or similar. The procedure for this is model after the W3 standard WebSub in order to provide authenticity and proven intent to receive data.

## Usage overview

* Required: setup of a FTP, SFTP or FTPS server were mfn can upload files to. More in the server section
* Recommended: Implementation of HMAC signature verification in order to prove authenticity the data.

#### **IPs, Location and Validation**

MFN is a HA distributed service running in the cloud, scaling up, down and recovering server failures according to its current need. This means that you should not expect the ftp upload to come from any particular IP, instead you should use `X-Hub-Signature` in the header file in order to verify that MFN is indeed the sender. This along with proper username and password should ensure proper authentication of the content.

However, we can ensure that the traffic comes from pre-determine ip addresses if this is necessary for a working setup

#### **Upload**

There will be 2 files written for each news item being pushed / uploaded to a server. One containing meta data information, the header files, and one containing the news item itself. The news item is the serialized as requested, with `json` or `xml` and is reflected by the file extension.

The header file will conform to typical http headers containing, `Content-type`, `Content-Disposition`, `X-Hub-Topic`, `X-Hub-Unsubscribe`, `X-Hub-Signature` and others&#x20;

Examples of a news item being uploaded with result in the two files

* `e0794633-5f0c-4edf-a4b3-4da07af8bb4a.headers`&#x20;

  Containing the meta data that can be used for validating the authenticity of the news item
* `e0794633-5f0c-4edf-a4b3-4da07af8bb4a.json`

  Containing the news item itself, described in the News Item model documentation, serialized as `json`

\\
