From 55f0e77759437eae8e57b617d2f2b71c02a404a4 Mon Sep 17 00:00:00 2001 From: hole-thu Date: Fri, 1 Apr 2022 04:49:27 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E6=95=B0=E6=8D=AE=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/UserAction.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/UserAction.js b/src/UserAction.js index 16a56742..1973966b 100644 --- a/src/UserAction.js +++ b/src/UserAction.js @@ -580,8 +580,8 @@ export class PostForm extends Component { let f = event.target.files[0]; if (f) { this.setState({ is_loading: true, file_type: f.type }); - let data = new FormData(); - data.append('file', f); + // let data = new FormData(); + // data.append('file', f); var xh = new XMLHttpRequest(); xh.upload.addEventListener( @@ -594,7 +594,7 @@ export class PostForm extends Component { xh.addEventListener('abort', this.upload_abort.bind(this), false); xh.open('POST', API_BASE + '/upload'); xh.setRequestHeader('User-Token', this.props.token); - xh.send(data); + xh.send(f); } }