# File Transfers

## File Formats <a href="#ftp-upload" id="ftp-upload"></a>

All files do not have specific naming requirements. Columns in .csv files or fields in .xml files can be named as they are used in the creating system or as per our data model as a guideline.

{% content-ref url="/pages/-LQpTnZA2sICcHRiB8fQ" %}
[Data Model](/docs/developers/v2/data-elements/data-model.md)
{% endcontent-ref %}

### CSV (Preferred)

Uploaded .csv files are accepted and should meet the following requirements:

* The first row needs to contain headings.
* The delimiter can be `, ; | + or TAB`.
* Quoting can be strict or non-strict, with char `'` or `"`.
* File encoding should be `UTF-8`, alternatively `ASCII` or `ISO 8859-1` is also accepted.

{% hint style="info" %}
Technically `UTF-8-SIG`, `UTF-16`, and `latin-1` are also accepted. `UTF-16` characters should not be inserted into non `UTF-16` files.
{% endhint %}

A sample file can be downloaded here.

{% file src="/files/-LsQgX0AV4uDorq84Ufy" %}
Sample .csv file
{% endfile %}

### JSON (Preferred)

Uploaded .json files are accepted.

A sample file can be downloaded here.

{% file src="/files/Hp5jXO8AuJPJKAhm1cNx" %}
Sample .json file
{% endfile %}

### XML

Uploaded .xml documents are accepted. Simple, nested .xml documents are preferred over .csv files if trackings are to be uploaded with a list of articles.

A sample file and the schema for a tracking can be downloaded here.

{% file src="/files/-LQpVJNX5KznEuZ7i9l7" %}
Sample .xml file
{% endfile %}

{% file src="/files/-LQpVsruKTQMUrmuTsbd" %}
XSD schema
{% endfile %}

### EDIFACT

Uploaded EDIFACT files are accepted and should follow the [UN/EDIFACT IFTMIN](http://www.unece.org/trade/untdid/d03a/trmd/iftmin_c.htm) specifications. You can test files for compatibility using our [edi-iftmin parser](https://github.com/parcelLab/edi-iftmin).

### Fixed Files

Uploaded .fixed files are accepted. These are like .csv files except instead of delimiter characters, columns end after a fixed number of characters in .fixed files.

A sample file can be downloaded here.

{% file src="/files/UOutmHPDMP0os0YTSCgI" %}
Sample .fixed file
{% endfile %}

## Transfer Channels

Uploaded files are archived by the system after successful import (that is: moved out of the import folder). The import is event-driven and should be done a couple of seconds after upload depending on the size of the uploaded file.

Credentials are assigned by our Support team as required for the services used.

### SFTP (Certificate)

The preferred transfer channel is through our SFTP server with certificate based authentication.

FTP servers can be either through parcelLab's servers or yours as follows:

* For parcelLab's servers (hub2.parcellab.com), we share a SSH key (certificate).
* For your servers, we can connect either using a username/password or with a SSH key (certificate).

```
Protocol: SFTP
Server: hub.parcellab.com
Port: 22
```

You need to provide parcelLab with your Public Key in OpenSSL format according to [RFC4253](https://tools.ietf.org/html/rfc4253#section-6.6). A compatible key format can be created like this:

* MacOS, Linux, Unix: Run ` ssh-keygen -P "" -m PEM -f`` `` `*`key_name`* in the terminal. You will generate two files in the current directory and you need to share your SSH Public Key in the *`key_name`*`.pub` file with us.
* Windows: With PuTTY, you can generate the key pair with the Public Key in `PUB` format, and the Private Key in `PPK` format. Again, only share your Public Key with us.

### SFTP (Password)

As an alternative to certificate based access, parcelLab also allow for authentication via password. For this, our team will generate a username and a random, secure password and share it with you.

```
Protocol: SFTP
Server: hub2.parcellab.com
Port: 22
```

### SFTP Legacy Data

With regards to legacy SFTP servers, if you put files on servers that do not distinguish between folders and files, this can cause errors when parcelLab try to download the files and can create delays. As a result, the FTP server must support the MLSD command and the LIST alone is *not* sufficient.

## Download

Our system can also download files via FTP-SSL and SFTP. In that case, requests will come from the following:

```
Request IP for Downloads:
18.197.138.147
```

{% hint style="info" %}
Please [fill in our contact form](https://parcellab.com/en/contact) and provide us with the server address, protocol, port, and access credentials.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.parcellab.com/docs/developers/v2/data-elements/send-data/file-transfers.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
