Data Types

DownloadFileParams

Parameter object passed to the DownloadFile method in the Bytescale SDKs.

{
"accountId": String,
"cache": Boolean,
"cache-ttl": Number,
"cache-ttl-404": Number,
"enc": String,
"exp": Object,
"filePath": String,
"meta-*": String,
"path": String,
"sig": String,
"version": String
}
{
"accountId": "YOUR_ACCOUNT_ID",
"cache": true,
"cache-ttl": 31536000,
"cache-ttl-404": 31536000,
"enc": "1.BMCyGyFk.6Kfhg5wI8t9AOaY1.tP2Q5uCTvhtefYNPjP7_wxv2mcWI65vLv4",
"exp": 1748005508,
"filePath": "/uploads/image.jpg",
"meta-*": "user-id-123",
"path": "/example/image.jpg",
"sig": "1.W2Sxdk7S.tbORdGfI3afWZAy79r6ivu7O6FnHei_bNZSB9MANIbU",
"version": "1"
}

Your account ID.

This is visible on the settings page:

https://www.bytescale.com/dashboard/settings

Example: "A623uY2"

Type: String

Length: 7

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

Default: true

Type: Boolean

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

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

Type: Number

Specifies the maximum amount of time, in seconds, that 404 responses will be cached in the Bytescale CDN's edge cache.

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

Type: Number

Carries the encrypted payload for an Encrypted URL: these are URLs where the query string portion of the URL has been encrypted using an API key. The query string cannot be read or modified without the API key used to encrypt the URL. When the request is received, Bytescale decrypts the query string and authorizes access using the current permissions of the API key.

This lets you securely grant access to private files via URLs (without requiring Authorization or Cookie headers).

See: Encrypted URLs

Example: "1.BMCyGyFk.6Kfhg5wI8t9AOaY1.tP2Q5uCTvhtefYNPjP7_wxv2mcWI65vLv4"

Type: String

Expires the URL at the given time.

Accepted values:

An integer (in milliseconds or seconds since January 1, 1970, 00:00:00 UTC)

The literal string inf to indicate that the URL should never expire (the default)

See: Expiring URLs

Absolute path to a file. Begins with a /.

Example: "/uploads/image.jpg"

Type: String

Min Length: 1

Max Length: 512

Attaches custom metadata to the URL without affecting CDN cacheability or generating unique transformations.

To include metadata, add query string parameters that begin with meta-.

Example: ?meta-user=123&meta-product=abc

When the URL is processed, all meta-* parameters are automatically stripped before transformation or caching occurs. This ensures that variations in metadata do not result in new transformations.

Example: "user-id-123"

Type: String

Allows you to optionally specify the file path of the requested file via the query string instead of the URL path. When provided, the path query string parameter takes precedence and overrides any file path included in the URL path.

This is especially useful with Encrypted URLs, which only encrypt the query string portion of the URL. By placing the file path in the query string using the path parameter, you ensure the location of the file is hidden and protected from tampering.

Must start with a "/".

Example: "/example/image.jpg"

Type: String

Carries the signature for a Signed URL: these are URLs that have been signed using an API key. This signature ensures the URL cannot be modified. When the request is received, Bytescale verifies the signature and authorizes access using the current permissions of the API key.

This lets you securely grant access to private files via URLs (without requiring Authorization or Cookie headers).

See: Signed URLs

Example: "1.W2Sxdk7S.tbORdGfI3afWZAy79r6ivu7O6FnHei_bNZSB9MANIbU"

Type: String

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: "1"

Type: String

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: