1.8.0 • Published 3 months ago

@rpldy/chunked-sender v1.8.0

Weekly downloads
949
License
MIT
Repository
github
Last release
3 months ago

Chunked Sender

Adds chunked upload capabilities on top of the regular XHR @rpldy/sender Exposes an UploaderEnhancer that replaces the default send method the uploader uses.

For usage with your React app, see @rpldy/chunked-uploady.

Chunked uploading doesn't support grouped uploads (in single XHR request) or URL uploading. These will be handed over to the default @rpldy/sender

The best place to get started is at our: React-Uploady Documentation Website

Installation

#Yarn:
  $ yarn add @rpldy/chunked-sender

#NPM:
  $ npm i @rpldy/chunked-sender

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

Events

Chunked Sender makes it possible to handle chunk life-time events. See uploader events section on more info regarding how to register for events.

CHUNK_EVENTS.CHUNK_START

Triggered when a chunk is about to be sent to the server

This event is cancellable

The event handler may return an object with the following shape:

type StartEventResponse = {
	url: string,
    sendOptions: ChunkedSendOptions
}

CHUNK_EVENTS.CHUNK_FINISH

Triggered when a chunk has finished uploading

Item Error

In case of chunk upload error in conjunction of using the ITEM_ERROR or the useItemErrorListener hook, it is possible to access the error information returned from the server like so:

import { useItemErrorListener } from "@rpldy/uploady";

const MyComponent = () => {
    useItemErrorListener((item) => {
        console.log(`item ${item.id} failed -  status code:`, item.uploadResponse.chunkUploadResponse.status); //the status code returned by the server on the failed chunk
        console.log(`item ${item.id} failed -  msg:`, item.uploadResponse.chunkUploadResponse.response); //the response data (if) sent by the server on the failed chunk
    });

    //...
};
1.8.0

3 months ago

1.8.0-rc.0

3 months ago

1.7.1

5 months ago

1.7.0

5 months ago

1.7.0-rc.1

5 months ago

1.7.0-rc.0

5 months ago

1.6.1

6 months ago

1.6.0

7 months ago

1.6.0-rc.0

7 months ago

1.5.0-rc.0

8 months ago

1.5.0-rc.1

8 months ago

1.5.0-rc.2

8 months ago

1.5.0-rc.3

8 months ago

1.5.0-rc.4

8 months ago

1.5.0-rc.5

8 months ago

1.5.0

8 months ago

1.6.1-rc.2

6 months ago

1.6.1-rc.0

6 months ago

1.6.1-rc.1

6 months ago

1.4.2-alpha.0

1 year ago

1.4.1

1 year ago

1.4.1-rc.0

1 year ago

1.4.0

1 year ago

1.4.0-rc.0

1 year ago

1.4.0-rc.1

1 year ago

1.3.1

1 year ago

1.2.0

2 years ago

1.3.0-rc.2

2 years ago

1.3.0-rc.3

1 year ago

1.3.0-rc.0

2 years ago

1.3.0-rc.1

2 years ago

1.3.0

1 year ago

1.1.0

2 years ago

1.0.1

2 years ago

1.1.0-rc.1

2 years ago

1.1.0-rc.0

2 years ago

1.0.0

2 years ago

0.18.3

2 years ago

0.18.1

2 years ago

0.18.2

2 years ago

0.18.0

2 years ago

0.17.2

2 years ago

0.17.3

2 years ago

0.17.4

2 years ago

0.17.5

2 years ago

0.17.0

2 years ago

0.17.1

2 years ago

0.16.1

2 years ago

0.16.2

2 years ago

0.15.0

2 years ago

0.16.0

2 years ago

0.14.2

3 years ago

0.14.0

3 years ago

0.14.1

3 years ago

0.13.6

3 years ago

0.13.5

3 years ago

0.13.4

3 years ago

0.13.3

3 years ago

0.13.1

3 years ago

0.13.2

3 years ago

0.13.0

3 years ago

0.12.0

3 years ago

0.11.5

3 years ago

0.11.4

3 years ago

0.11.2

3 years ago

0.11.3

3 years ago

0.11.3-alpha.0

3 years ago

0.11.0

3 years ago

0.11.1

3 years ago

0.10.0

3 years ago

0.9.0

3 years ago

0.8.3

3 years ago

0.8.2

3 years ago

0.8.1

3 years ago

0.8.0

3 years ago

0.7.4

3 years ago

0.7.3

3 years ago

0.7.2

3 years ago

0.7.1

4 years ago

0.7.0

4 years ago

0.6.0

4 years ago

0.5.0

4 years ago

0.4.1

4 years ago

0.4.0

4 years ago

0.3.2

4 years ago

0.3.0

4 years ago

0.2.4

4 years ago

0.2.3

4 years ago

0.2.2

4 years ago

0.2.0

4 years ago

0.1.12

4 years ago

0.1.11

4 years ago

0.1.10

4 years ago

0.1.9

4 years ago

0.1.8

4 years ago

0.1.7

4 years ago