首页 > 解决方案 > 元素ui上传组件不发送流数据

问题描述

使用 el-upload 组件上传图片

我从服务器收到 204 no content response

   el-upload(
        action="https://s3-us-west-1.amazonaws.com/stage.greenausm.com",
        :mulitple="false",
        :data="xhrData"
        :show-file-list="false", :on-success="handleAvatarSuccess",
        :before-upload="beforeAvatarUpload",
      )

对服务器的请求没有图像数据

------WebKitFormBoundaryksB7UzZHz8SWLdPk Content-Disposition: form-data; 名称=“文件”;文件名="img.jpg" 内容类型:图像/jpeg

------WebKitFormBoundaryksB7UzZHz8SWLdPk--

如何让组件发送图像数据

标签: uploadelement-ui

解决方案


 handleChange(file, fileList){
                    this.fileList.push(file);
                },
:on-change="handleChange"
:file-list="ListFiles"


推荐阅读