TusUploady
Packageβ
Installationβ
- npm
- Yarn
- pnpm
npm install @rpldy/tus-uploady
yarn add @rpldy/tus-uploady
pnpm add @rpldy/tus-uploady
Propsβ
Name (* = mandatory) | Type | Default | Description |
---|---|---|---|
version | string | "1.0.0" | The tus server version |
featureDetection | boolean | false | whether to query the server for supported extensions |
featureDetectionUrl | string | null | URL to query for TUS server feature detection, in case it's different from upload URL |
onFeaturesDetected | (string[]) => ?TusOptions | void | callback to handle the extensions the server broadcasts |
resume | boolean | true | whether to store information locally on files being uploaded to support resuming |
deferLength | boolean | false | defer sending file length to server (protocol) |
overrideMethod | boolean | false | whether to use X-HTTP-Method-Override header instead of PATCH |
sendDataOnCreate | boolean | false | send first chunk with create request (protocol) |
storagePrefix | string | "__rpldy-tus__" | the key prefix to use for persisting resumable info about files |
lockedRetryDelay | number | 2000 | milliseconds to wait before retrying a locked (423) resumable file |
forgetOnSuccess | boolean | false | whether to remove URL from localStorage when upload finishes successfully |
ignoreModifiedDateInStorage | boolean | false | ignore File's modified date when creating key for storage |
resumeHeaders | Record<string, string> | null | Headers to use for the resume check (HEAD) request |
In addition, all UploadOptions props can be passed to ChunkedUploady.
See Uploady documentation for detailed list of upload options.
All chunked-sender options are supported as well
Params prop that is set on the Destination or upload options is serialized (encoded according to Tus protocol) and sent as the value of the Upload-Metadata header.
Custom headers set on the Destination will be sent (and override existing headers) with the Creation request
Feature Detectionβ
Tus servers may broadcast the features (extensions) they support.
Uploady can query those and turn on/off certain features.
By default, it will not make this query. Querying can be turned on by passing true
to the featureDetection
prop.
Resume Headersβ
These are (optional) headers that are only used for the resume (HEAD) request.