Data Types

UploadManagerParams

Parameter object passed to the UploadManager.upload(params) method in the Upload SDKs.

Structure

Example

{
"accountId": "YOUR_ACCOUNT_ID",
"cancellationToken": {
"isCancelled": false
},
"data": "Hello World",
"maxConcurrentUploadParts": 2,
"metadata": {
"myCustomField1": true,
"myCustomField2": {
"hello": "world"
},
"anotherCustomField": 42
},
"mime": "text/plain",
"originalFileName": "example.txt",
"path": {
"fileName": "example-{UNIQUE_DIGITS_4}{ORIGINAL_FILE_EXT}",
"folderPath": "/uploads"
},
"size": 11,
"tags": [
"example_tag"
]
}

Properties

accountId

Your account ID.

This is visible on the settings page:

https://upload.io/dashboard/settings

Example: "A623uY2"

Type: String

Length: 7

Required: Yes

cancellationToken

Cancellation token to allow the upload to be cancelled after it has started.

Type: CancellationToken

Required: No

data

The data to upload.

The supported types for this parameter vary between the different Upload SDKs.

Please refer to each SDK's documentation for this field's type.

Required: Yes

maxConcurrentUploadParts

Type: Number

Required: No

metadata

Arbitrary JSON to store against the file as metadata.

You can retrieve this later via a GetFileDetails request.

Type: FileMetadata

Required: No

mime

The file's MIME type.

Example: "text/plain"

Type: String

Min Length: 3

Max Length: 255

Required: No

originalFileName

The file's original name on the user's device.

Example: "example.txt"

Type: String

Min Length: 1

Max Length: 255

Required: No

path

The path to upload the file to.

Type: FilePathDefinition

Required: No

size

Size of the file data being uploaded, in bytes.

Conditional: only include if both data is a stream.

Example: 11

Type: Integer

Minimum: 0

Required: No

tags

The file tags to store against the file.

When you associate file tags with a file, Upload checks which rules match the tags (if any) and applies those rules to the upload request:

Rules can include max file size checks, traffic limit checks, rate limit checks, and so forth. These are configured in the Upload Dashboard.

Example: ["example_tag"]

Type: String[]

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: