Skip to main content

getChunkedEnhancer

Package​

Installation​

npm install @rpldy/chunked-sender

Details​

type getChunkedEnhancer = (options: ChunkedOptions) => UploaderEnhancer

Creates an uploader enhancer that can be handed to the Uploady (using the enhancer prop), or to the uploader.

warning

When using React, there's typically no need to use this enhancer directly. Using Chunked-Uploady will do this for you automatically.

Options​

Name (* = mandatory)TypeDefaultDescription
chunkedbooleantruechunk uploads. setting to false will return to default sending behavior
chunkSizenumber5242880the chunk size. relevant when uploaded file is larger than the value
retriesnumber0how many times to retry sending a failed chunk
parallelnumber0how many (chunk) requests to send simultaneously

Example​

import Uploady from "@rpldy/uploady";
import { getChunkedEnhancer } from "@rpldy/chunked-sender";

const chunkedEnhancer = getChunkedEnhancer({
chunkSize: 1e+6
});

const App = () => (
<Uploady
destination={{ url: "https://my-server" }}
enhancer={chunkedEnhancer}
>
<RestOfMyApp/>
</Uploady>
)

See: composeEnhancers