You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+93-67Lines changed: 93 additions & 67 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ This SDK helps you efficiently upload large files from the browser by splitting
4
4
5
5
Please note that this SDK is designed to work only with FastPix and is not a general purpose uploads SDK.
6
6
7
-
##Features:
7
+
# Features:
8
8
9
9
-**Chunking:** Files are automatically split into chunks (configurable, default size is 16MB/chunk).
10
10
-**Pause and Resume:** Allows temporarily pausing the upload and resuming after a while.
@@ -13,84 +13,99 @@ Please note that this SDK is designed to work only with FastPix and is not a gen
13
13
-**Error Handling and Reporting:** Comprehensive error handling to manage upload failures gracefully and inform users of issues.
14
14
-**Customizability:** Developers can customize the chunk size and retry attempts based on their specific needs and network conditions.
15
15
16
-
## Installation
16
+
#Prerequisites:
17
17
18
-
To install the SDK, you can use npm or your favourite node package manager 😉:
18
+
## Getting started with FastPix:
19
+
20
+
To get started with SDK, you will need a signed URL.
21
+
22
+
To make API requests, you'll need a valid **Access Token** and **Secret Key**. See the [Basic Authentication Guide](https://docs.fastpix.io/docs/basic-authentication) for details on retrieving these credentials.
23
+
24
+
Once you have your credentials, use the [Upload media from device](https://docs.fastpix.io/reference/direct-upload-video-media) API to generate a signed URL for uploading media.
25
+
26
+
## Installation:
27
+
28
+
To install the SDK, you can use NPM, CDN, or your preferred package manager:
29
+
30
+
### Using NPM:
19
31
20
32
```bash
21
33
npm i @fastpix/resumable-uploads
22
34
```
23
35
24
-
## Basic Usage
25
-
26
-
To get started with SDK, you will need a signed URL.
36
+
### Using CDN:
27
37
28
-
To make API requests, you'll need a valid **Access Token** and **Secret Key**. See the [Basic Authentication Guide](https://docs.fastpix.io/docs/basic-authentication) for details on retrieving these credentials.
Once you have your credentials, use the [Upload media from device](https://docs.fastpix.io/reference/direct-upload-video-media) API to generate a signed URL for uploading media.
| `endpoint` | `string` or `() =>Promise<string>` | Required | The signed URL endpoint where the file will be uploaded. Can be a static string or a function returning a `Promise` that resolves to the upload URL. |
140
+
| `file` | `File` or `Object` | Required | The file object to be uploaded. Typically a `File` retrieved from an `<input type="file"/>` element, but can also be a generic object representing the file. |
141
+
| `chunkSize` | `number` (in KB) | Optional | Size of each chunk in kilobytes. Default is `16384` KB (16 MB).<br>**Minimum:** 5120 KB (5 MB), **Maximum:** 512000 KB (500 MB). |
142
+
| `maxFileSize` | `number` (in KB) | Optional | Maximum allowed file size for upload, specified in kilobytes. Files exceeding this limit will be rejected. |
143
+
| `retryChunkAttempt` | `number` | Optional | Number of retry attempts per chunk in case of failure. Default is `5`. |
144
+
| `delayRetry` | `number` (in seconds) | Optional | Delay between retry attempts after a failed chunk upload. Default is `1` second. |
145
+
146
+
### Example usage of integrating all parameters with `Uploader.init`
0 commit comments