How to download memory stream object via angularJS and webaAPI2

前端 未结 1 1814
广开言路
广开言路 2021-01-25 00:45

I have a project where I am using NPOI to generate Excel document from my Angular application. I have the calls being made from my angular service to my webapi controller as fol

相关标签:
1条回答
  • 2021-01-25 01:12

    I had a similar problem. I solved that changing the endpoint to support GET and calling this method from a new tab.

    So from your angular app you have to create a new tab pointing to the path that calls the method that generate your document. You can open a tab with the next code:

    $window.open(path)
    

    I think that in the next link you can have all the information that you need:

    Download file from an ASP.NET Web API method using AngularJS

    I hope that it helps.

    0 讨论(0)
提交回复
热议问题