Skip to main content

TusUploady

Package​

@rpldy/tus-uploady

Installation​

npm install @rpldy/tus-uploady

Props​

Name (* = mandatory)TypeDefaultDescription
versionstring"1.0.0"The tus server version
featureDetectionbooleanfalsewhether to query the server for supported extensions
featureDetectionUrlstringnullURL to query for TUS server feature detection, in case it's different from upload URL
onFeaturesDetected(string[]) => ?TusOptionsvoidcallback to handle the extensions the server broadcasts
resumebooleantruewhether to store information locally on files being uploaded to support resuming
deferLengthbooleanfalsedefer sending file length to server (protocol)
overrideMethodbooleanfalsewhether to use X-HTTP-Method-Override header instead of PATCH
sendDataOnCreatebooleanfalsesend first chunk with create request (protocol)
storagePrefixstring"__rpldy-tus__"the key prefix to use for persisting resumable info about files
lockedRetryDelaynumber2000milliseconds to wait before retrying a locked (423) resumable file
forgetOnSuccessbooleanfalsewhether to remove URL from localStorage when upload finishes successfully
ignoreModifiedDateInStoragebooleanfalseignore File's modified date when creating key for storage
resumeHeadersRecord<string, string>nullHeaders 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

note

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.

info

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.