# Submit Documents (SFTP)

Submit a document or set of documents on behalf of an end user via SFTP.

***

{% hint style="info" %}
sFOX recommends [submitting documents via HTTP request](/connect/rest-api/end-users/submit-documents.md) instead of this SFTP method. Please contact support at <support@sfox.com> if you are unsure or would like additional information.
{% endhint %}

## How to upload files via SFTP server

SFTP stands for Secure File Transfer Protocol. It is a network protocol that allows the transfer of files over a secure data stream.

{% hint style="warning" %}
**Note:** If you are submitting documents as responses EDD requests, ***you must*** [***Create EDD Responses***](/connect/rest-api/end-users/create-edd-responses.md) ***with the associated file names before uploading documents to the SFTP server.*** Failure to do so will require re-uploading the document(s).
{% endhint %}

### <mark style="color:blue;">MacOS or Linux</mark>

### Create a pair of SSH public/private keys

Secure Shell (SSH) keys are used for authentication to grant access to sFOX's SFTP server.

1. Open your terminal
2. Type `ssh-keygen -t rsa` into your terminal
3. Enter file `id_rsa`
4. Enter passphrase (optional)
5. Retrieve and view your private and public key by typing in:
   1. Private key: `cat ~/id_rsa`
   2. Public key: `cat ~/id_rsa.pub`

### Create a Directory

Once you have retrieved your public key, please copy the entire string and send it over to your sFOX representative.

sFOX will create a directory for you in our database before you can start uploading onto the SFTP server.

sFOX will notify you once your directory has been created in our database.

<details>

<summary>Example Public Key</summary>

<pre data-overflow="wrap"><code><strong>ssh-rsa AAAAB3NzaC1yc2E132AADAQABAAABgQDhr76la1NoO+1qXYeYQsrYWu1rYTiGacJUgmIf7yiNQna6ECSL4eTHALMSk51kNKr41JgsNipeLU70CYAlh+IExHPLI8uoFeDVfvAfeDUP3lvOJbjXe/7TUUjwYyYk7S0wolWfJvZ2LqdApALO6YzjXDLYAj33oniNoq3ope1LoPdHpvtUDl2+aXpW5x1DKzq3Lpy+hXYItuxMzmBatG40tGAGNbivf4brnzUoqwl9CBcvytXkmfYky12DAxTPmuu6bdkA3/B3gxZ1MDZ1pMKFnB70cCWoAbpF2/DMNZorY4AO0fP/sfUFM3aj9PTchw4CfBr3tKG7ugbFBu7p33qy39SukCyipimZfqlEWFRZlQ/ujFtNwC2LRotmpFkEW6lXBa52lHnDkf8vHGvel6IJIYy0S5YCSqhBKmGNskcN9fBi5ih30CSEHs6snjCg5+v3SMKrHRDSY5c18N5RTKLbXFSVrqUCxtgRcnNlWVCENh/LL/1K8+8haDYjvIXgmgGk= administrator@adminisatorsMBP
</strong></code></pre>

</details>

### Uploading Files

Once you have your directory set up with your public key, you are now ready to upload the files you have responded in the EDDQ.

1. Connect to sFOX's SFTP server by running this command in your Terminal: `sftp -i id_rsa sftp.sfox.com`
2. If this is your first time connecting, you will be ask if you want to continue connecting. Select `Yes`

You should see a message `Connected to sftp.sfox.com` on your Terminal

3. Upload a file by running this command: `put <file_path>`

You should see a message `Uploading <file_path> to <file_path>`  Once you see this message, your file has been uploaded to sFOX's SFTP server!

{% hint style="info" %}
An easier method to upload a file is to drag-and-drop the file into the Terminal. This will automatically generate the \<file\_path> for you
{% endhint %}

#### Removing Files

If, for any reason, you would like to remove a file that was previously uploaded to the SFTP server, you can run this command: `rm <new_file_path>`

### <mark style="color:blue;">Windows</mark>

For Microsoft Windows, you should use an sFTP capable client application such as:

1. FileZilla (<https://filezilla-project.org/>)
2. WinSCP (<https://winscp.net/>).

Detailed instructions can be found below:

* <https://wiki.filezilla-project.org/Howto>
* <https://winscp.net/eng/docs/ui_login_authentication>


---

# 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.sfox.com/connect/rest-api/end-users/submit-documents/submit-documents-sftp.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.
