React开发(267):ant design upload简单上传
Posted 前端小歌谣
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了React开发(267):ant design upload简单上传相关的知识,希望对你有一定的参考价值。
## 如果只是简单的上传,没必要写 customRequest
```javascript
<Upload
name="file"
action=`$BASE_URL/common/file/uploadByStream`
headers= authorization: localStorage.getItem('token'),
'x-sys-encode': '115992066215908888170874',
'x-sys-terminal': '15986015651108888222042',
data= fileCode: 'STUDY_ATTACHMENT'
onChange=this.handleUploadExtraFile
defaultFileList=articleAttachments
>
<Button>
<Icon type="upload" /> 上传
</Button>
<span style= marginLeft: 20 >支持扩展名:doc .docx .pdf .jpg,jpeg</span>
</Upload>
```
以上是关于React开发(267):ant design upload简单上传的主要内容,如果未能解决你的问题,请参考以下文章
React开发(165):ant design validateFields
React开发(165):ant design validateFields
React开发(266):ant design customRequest