# Upload Files with CLI

Upload files and folders, including metadata, through the command-line.

***

## About This Task

Uploading through CLI is asynchronous. It's the recommended method if you have a lot of files to upload or want to upload files with metadata. To learn more, see also [Upload Files](/docs/how-to-guides/working-with-your-data/upload-files.mdx) and [Working with Metadata](/docs/how-to-guides/working-with-your-data/working-with-metadata/use-metadata-in-your-search-system.mdx).

### Sessions

<AsyncUploadInfo />

### Folder Structure

<UploadFolderStructureInfo />

### File Extensions

<FileExtensionWarning />

## Prerequisites

<SdkInstallationSteps />

## Upload Files

1. Pass your API key and the name of the <ProductShortName /> workspace where you want to upload the files. (You can also skip this step and just pass your API key and workspace in the `update` command.)
   ```python
   # This command prompts you to pass the deepset API key and workspace name
   deepset-cloud login
   ```
2. Run the following command to upload your files, specifying any options you want:
   ```python
   deepset-cloud upload <folder_path>
   ```

While the upload is progressing, you can first see the upload status, which means the files were uploaded to the S3 bucket, and then the ingestion status, which means the files are being transferred to <ProductName />. Both processes must be successful for the files to be uploaded to <ProductName />.

## Examples

- Upload all TXT and PDF files from the folder, including subfolders, and overwrite any duplicate files: 
  ```python
  deepset-cloud upload ./hotel_reviews --recursive --write-mode OVERWRITE
  ```
- Upload Markdown files passing the workspace name and API key: 
  ```python
  deepset-cloud upload ./hotel_reviews --api-key api_123 --workspace-name my_workspace 
  ```
- Upload only JSON files from a collection of multiple file types:
  ```python
  deepset-cloud upload ./hotel_reviews --api-key api_123 --workspace-name my_workspace --use-type .json
  ```
