# How do I download a GB Files transfer with curl or wget?

> Every file has a stable download link that supports range requests. Use curl -C - or wget -c to download to a server and resume if the connection drops.

Source: https://gbfiles.com/questions/download-with-curl

## The short answer

Open the transfer link, select **curl** next to a file, and copy the command. It looks like this:

```sh
curl -fL -C - -o cut.mov https://gbfiles.com/d/<transfer>/<file>
```

- `-C -` resumes from the end of the partial file if you run it again.
- `-f` stops curl from saving an error message as the file if something's wrong.
- `-L` follows redirects.

With wget:

```sh
wget -c -O cut.mov https://gbfiles.com/d/<transfer>/<file>
```

The link works for the whole 7 days, so you can re-run either command hours or days later.

## Password-protected transfers

The download page gives you a link with a per-file token after you enter the password, so the password itself never appears in the command. You can also pass the password with HTTP basic auth:

```sh
curl -fL -C - -u ":the-password" -o cut.mov https://gbfiles.com/d/<transfer>/<file>
```

## Downloading every file in a transfer

The simplest way is the GB Files CLI, which recreates the folder structure, resumes partial files, and can check every chunk's SHA-256:

```sh
npx gbfiles download https://gbfiles.com/t/<transfer> --out ./incoming --verify
```

Or with curl and jq only:

```sh
T=<transfer>
curl -s https://gbfiles.com/v1/transfers/$T/manifest.json \
  | jq -r '.files[] | "\(.id)\t\(.relativePath)"' \
  | while IFS=$'\t' read -r id path; do
      mkdir -p "$(dirname "$path")"
      curl -fL -C - -o "$path" "https://gbfiles.com/d/$T/$id"
    done
```

## FAQ

### Do I need an account or API key?

No. The link is enough, plus the password if the sender set one.

### Can I use a multi-connection download manager?

Yes. Range requests are supported, so tools like aria2 can split a file across connections: `aria2c -x 4 -o cut.mov <link>`.
