> ## Documentation Index
> Fetch the complete documentation index at: https://developer.onecodex.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Uploads Overview

FASTA and FASTQ files may be uploaded via the REST API or by using the One Codex CLI or Python client library.

The latter two options are simpler and thus recommended (and also support automatic interleaving and validation of your FASTA/Qs). In every case, we replace spaces in filenames with underscores. To upload with the CLI, simply:

<CodeGroup>
  ```shell shell theme={null}
  # If you haven't previously logged in, the following command
  # will prompt you for your username and password and then
  # save a ~/.onecodex file with your API key
  onecodex login

  # This command will automatically upload all FASTQs into your account,
  # prompting you to interleave any paired end data (recommended) if applicable
  onecodex upload $LIST_OR_GLOB_OF_YOUR_SAMPLES
  ```
</CodeGroup>

Uploading via the REST API consists of 3 steps:

* (1) Initiating an upload by POSTing to [`/samples/init_upload`](/api-reference/sample-resource-upload-file)
* (2) Uploading the sample to the provided `upload_url` and with any `additional_fields` provided. See the [Starting an Upload](/api-reference/sample-resource-upload-file) documentation for more details.
* (3) Confirming the upload by POSTing to [`/samples/confirm_upload`](/api-reference/sample-resource-preupload)

## Samples over 20GB

The REST upload above only allows sample uploads up to 20GB (optionally compressed with `gzip`). If you need to upload a compressed file *over* 20GB, please use the `onecodex` CLI.
