> For the complete documentation index, see [llms.txt](https://docs.podigee.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.podigee.com/documentation/start-here/ai-agents/transfer-media-encode-and-publish/upload-local-media-with-the-pdg-cli.md).

# Upload local media with the pdg CLI

Transfer a local media file through a resumable Podigee upload session.

Use `pdg upload` to create, transfer, complete, and safely resume a local media upload.

## Before you start

* Install the pdg CLI and sign in.
* Confirm `pdg me` shows the intended account.
* Prepare the file and a stable idempotency key.
* Grant media write access.

## Upload the file

```sh
pdg --write upload episode.mp3 --idempotency-key "episode-2026-08-06-upload-v1"
```

1. Run the command with the local file.
2. Keep the upload plan or upload ID shown by the CLI.
3. Let the CLI transfer every required part.
4. Wait for server-side completion validation.
5. Keep the final `upload_id` from the completed session.

The CLI uses the server-provided upload mode, part sizes, headers, and short-lived URLs. It can renew URLs without starting a new session.

## Expected result

The upload session reaches `completed` and returns an opaque `upload_id` that can be attached to one episode production.

## If the upload is interrupted

Resume with the saved plan or upload ID:

```sh
pdg --write upload episode.mp3 --upload-id "UPLOAD_ID"
```

Use the same local file. Do not create a new session until you inspect the existing one.

## Next step

[Create an episode production from uploaded media](/documentation/start-here/ai-agents/transfer-media-encode-and-publish/create-an-episode-production-from-uploaded-media.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.podigee.com/documentation/start-here/ai-agents/transfer-media-encode-and-publish/upload-local-media-with-the-pdg-cli.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
