React中的文件上传
作者:互联网
const data = new FormData(); data.append('file', this.fileInput.current.files[0]); //相当于 input:file 中的name属性 fetch('http://127.0.0.1:3001/file/upload', { method: 'POST', body: data }).then(response => console.log(response))
来源:https://segmentfault.com/a/1190000016824949?utm_source=tag-newest
标签:body,文件,newest,0.1,data,React,file,上传,response 来源: https://www.cnblogs.com/qianxiaoPro/p/14760588.html