Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zhaozhuoboy/upload-antd-react
使用antd的上传组件做上传文件功能
https://github.com/zhaozhuoboy/upload-antd-react
antd axios file-upload react upload
Last synced: about 2 months ago
JSON representation
使用antd的上传组件做上传文件功能
- Host: GitHub
- URL: https://github.com/zhaozhuoboy/upload-antd-react
- Owner: zhaozhuoboy
- Created: 2017-12-27T06:02:34.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2017-12-28T04:28:57.000Z (about 7 years ago)
- Last Synced: 2023-03-05T03:03:14.186Z (almost 2 years ago)
- Topics: antd, axios, file-upload, react, upload
- Language: JavaScript
- Size: 109 KB
- Stars: 9
- Watchers: 0
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### 文件上传
1. antd 拖拽上传组件,自动触发上传接口
2. antd 上传按钮,手动上传
``` js
#手动上传给axios添加 headers
const config ={
headers:{
'Content-Type':'application/x-www-form-urlencoded'
}
}axios.post('http://localhost:3000/api/upload/formdata', formData,config)
.then( res => {
console.log(res)
}).catch( err => console.log(err))
```3. input[type:file] 获取原生DOM file列表
### 后端代码
[传送门:rocket:](https://github.com/zhaozhuoboy/koa2-study)