Skip to content

Commit 744a778

Browse files
committed
doc for customRequest prop
1 parent 7ffa0ca commit 744a778

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ React.render(<Upload />, container);
7070
|onSuccess | function | | success callback |
7171
|onProgress | function || progress callback, only for modern browsers|
7272
|beforeUpload| function |null| before upload check, return false or a rejected Promise will stop upload, only for modern browsers|
73+
|customRequest | function | null | provide an override for the default xhr behavior for additional customization|
7374
|withCredentials | boolean | false | ajax upload with cookie send |
7475

7576
#### onError arguments
@@ -84,6 +85,23 @@ React.render(<Upload />, container);
8485
2. `file`: upload file
8586

8687

88+
### customRequest
89+
90+
Allows for advanced customization by overriding default behavior in AjaxUplaoder. Provide your own XMLHttpRequest calls to interface with custom backend processes or interact with AWS S3 service through the aws-sdk-js package.
91+
92+
customRequest callback is passed an object with:
93+
94+
* `onProgress: (event: { percent: number }): void`
95+
* `onError: (event: Error, body?: Object): void`
96+
* `onSuccess: (body: Object): void`
97+
* `data: Object`
98+
* `filename: String`
99+
* `file: File`
100+
* `withCredentials: Boolean`
101+
* `action: String`
102+
* `headers: Object`
103+
104+
87105
### methods
88106

89107
abort(file?: File) => void: abort the uploading file

0 commit comments

Comments
 (0)