Skip to content

zhaozhuoboy/upload-antd-react

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

文件上传

  1. antd 拖拽上传组件,自动触发上传接口

  2. antd 上传按钮,手动上传

  #手动上传给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))
  1. input[type:file] 获取原生DOM file列表

后端代码

传送门:rocket:

About

使用antd的上传组件做上传文件功能

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published