通过邮递员成功上传文件,但在前端失败(vue)

时间:2019-04-29 01:18:18

标签: vue.js axios

我已经成功地通过邮递员上传了文件,并且文件已经移动到了文件夹中,但是当我尝试使用前端(vuejs)时,没有任何错误,但是文件没有移动,

_upload(){

  let fd = new FormData();
  fd.append('photo', this.photo); // this.photo is base64 data

  this.axios.post('upload_photo', fd, {
    headers: {
      'content-type': 'multipart/form-data'
    }
  }

  ).then(res => {
    console.log(res)
  }).catch(err => {
    console.log(err)
  })
}

0 个答案:

没有答案