Skip to content

Commit

Permalink
⚡ support Upload method
Browse files Browse the repository at this point in the history
  • Loading branch information
afc163 committed Nov 3, 2019
1 parent 767d2d0 commit 53efaa8
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions components/upload/index.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Uploading is the process of publishing information (web pages, text, pictures, v
| --- | --- | --- | --- | --- |
| accept | File types that can be accepted. See [input accept Attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#accept) | string | - | |
| action | Uploading URL | string\|(file) => `Promise` | - | |
| method | http method of upload request | string | 'post' | 3.25.0 |
| directory | support upload whole directory ([caniuse](https://caniuse.com/#feat=input-file-directory)) | boolean | false | 3.7.0 |
| beforeUpload | Hook function which will be executed before uploading. Uploading will be stopped with `false` or a rejected Promise returned. **Warning:this function is not supported in IE9**| (file, fileList) => `boolean | Promise` | - | |
| customRequest | override for the default xhr behavior allowing for additional customization and ability to implement your own XMLHttpRequest | Function | - | |
Expand Down
1 change: 1 addition & 0 deletions components/upload/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ title: Upload
| --- | --- | --- | --- | --- |
| accept | 接受上传的文件类型, 详见 [input accept Attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#accept) | string || |
| action | 上传的地址 | string\|(file) => `Promise` || |
| method | 上传请求的 http method | string | 'post' | 3.25.0 |
| directory | 支持上传文件夹([caniuse](https://caniuse.com/#feat=input-file-directory)| boolean | false | 3.7.0 |
| beforeUpload | 上传文件之前的钩子,参数为上传的文件,若返回 `false` 则停止上传。支持返回一个 Promise 对象,Promise 对象 reject 时则停止上传,resolve 时开始上传( resolve 传入 `File``Blob` 对象则上传 resolve 传入对象)。**注意:IE9 不支持该方法**| (file, fileList) => `boolean | Promise` || |
| customRequest | 通过覆盖默认的上传行为,可以自定义自己的上传实现 | Function || |
Expand Down
1 change: 1 addition & 0 deletions components/upload/interface.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export interface UploadProps {
action?: string | ((file: RcFile) => string) | ((file: RcFile) => PromiseLike<string>);
directory?: boolean;
data?: object | ((file: UploadFile) => object);
method?: 'POST' | 'PUT' | 'post' | 'put';
headers?: HttpRequestHeader;
showUploadList?: boolean | ShowUploadListInterface;
multiple?: boolean;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
"rc-tree": "~2.1.0",
"rc-tree-select": "~2.9.1",
"rc-trigger": "^2.6.2",
"rc-upload": "~2.8.0",
"rc-upload": "~2.9.1",
"rc-util": "^4.10.0",
"react-lazy-load": "^3.0.13",
"react-lifecycles-compat": "^3.0.4",
Expand Down

0 comments on commit 53efaa8

Please sign in to comment.