Downloading Excel file after creating using EPPlus

后端 未结 4 1910
再見小時候
再見小時候 2021-01-02 01:20

I am using the EPPlus library to generate an excel file which I successfully save in a folder on the server.

How can download this file to my local machine?

<
4条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-02 01:45

    Instead of using package.Save() you can use package.GetAsByteArray() which will return a byte array which you can then stream using FileResult or FileContentResult from the MVC action to trigger a file download. This method will allow you to download the file without saving it to the server first.

提交回复
热议问题