how to download a zip file

后端 未结 3 1180
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-09 04:00

I am trying to download a zip file from my web api controller. It is returning the file but I am getting a message the zipfile is invalid when i try to open. I have seen oth

3条回答
  •  北海茫月
    2020-12-09 04:38

    I think you're setting the responseType in the wrong place, instead of this:

    $http.post('/api/apiZipPipeLine/', model)
    

    Try this:

    $http.post('/api/apiZipPipeLine/', model, {responseType:'arraybuffer'})
    

    Take a look at this answer for more details.

提交回复
热议问题