Data Types

DownloadFile

To download files:

https://upcdn.io/{accountId}/raw/{filePath}

For example:

https://upcdn.io/W142hJk/raw/example/image.jpg

For private files: you must append ?auth=true to your URLs and have a valid JWT cookie (see: authorization). Alternatively, you can download private files using API keys like in the examples below.

To download files using code:

GET https://upcdn.io/{accountId}/raw/{filePath}
cURL
1curl "https://upcdn.io/{accountId}/raw/{filePath}" \
2 -H "Authorization: Bearer YOUR_API_KEY"
Response (200)
1Binary response

Response Body

The file's contents.

URL Parameters

accountId

Your account ID.

This is visible on the settings page:

https://upload.io/dashboard/settings

Example: A623uY2

Type: String

Length: 7

In: Path

Required: Yes

filePath

Absolute path to a file. Begins with a /.

Example: /uploads/image.jpg

Type: String

Min Length: 1

Max Length: 512

In: Path

Required: Yes

auth

Must be set when using JWT cookies to download private files.

Do not include this parameter otherwise.

Default: false

Type: Boolean

In: Querystring

Required: No

cache

Specifies whether to cache the raw file in the Upload CDN.

Default: true

Type: Boolean

In: Querystring

Required: No

cache_ttl

Specifies the maximum amount of time, in seconds, the file will be cached on the user's device and in the Upload CDN's edge cache.

Default: Please refer to your account's default cache settings in the Upload Dashboard.

Type: Number

In: Querystring

Required: No

download

Forces the browser to display a download prompt for the file, instead of displaying the file in the browser.

When set to true, the Upload CDN will add a content-disposition: attachment header to the HTTP response.

Example: ?download=true

Type: Boolean

In: Querystring

Required: No

version

Downloads the latest version of your file (if you have overwritten it) when added to the URL with a unique value.

The value of the version parameter can be anything, e.g. an incremental number, a timestamp, etc.

You only need to provide and update this value if/when you overwrite your file.

Example: ?version=1

Type: String

In: Querystring

Required: No

Request Headers

Authorization

Add one of these Authorization header values to your request:

Option 1: prefix "Bearer " to your API key. The result is your Authorization header value.

Option 2: use HTTP basic authorization, specifying apikey as your username, and your API key as your password.

Type: String

In: Header

Required: No

Was this section helpful? Yes No

You are using an outdated browser.

This website requires a modern web browser -- the latest versions of these browsers are supported: