Сохранение файла Excel в определенной папке - PullRequest
0 голосов
/ 22 февраля 2019

Извините, что задаю очень простой вопрос, я новичок в ASP.NET.Я просто хочу знать, как сохранить загруженный файл Excel в определенную папку.Вот мой код для загрузки листа Excel.

    public void ExcelForMonthlyReport(DateTime? startDate, DateTime? endDate)
    {
        MonthlyReportExcel excelMonthlyReport = new MonthlyReportExcel();//This class has all excel formating.
        Response.ClearContent();
        Response.BinaryWrite(excelMonthlyReport.GenerateMonthlyReport(GeMonthlyUploadData(startDate, endDate)));//method which gives data for excelsheet.
        Response.AppendHeader("content-disposition", $"attachment; filename = Monthly Report {DateTime.Now:yyyy-MM-dd - HH.mm.ss}.xlsx");
        Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
        Response.Flush();
        Response.End();
    }
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...