Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.9k views
in Technique[技术] by (71.8m points)

elementUI,upload上传,后端返回文件流如何下载?

用的elementUI框架,在使用upload上传后,后端返回文件流,如果是get请求,会设置responseType="blob"进行下载,现在upload组件默认post请求,无法设置responseType="blob",下载下来报错,请问如何下载
image
image
image


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

这样设置responseType不行吗

<el-upload
  :headers="{responseType:'blob'}"
>
</el-upload>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...