Skip to content

Commit

Permalink
Merge branch 'main' into feature/147247-Update-Project-List-View
Browse files Browse the repository at this point in the history
  • Loading branch information
elielijah321 authored Dec 14, 2023
2 parents 5339d8c + 37c6d58 commit e74fc91
Showing 1 changed file with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using Dfe.PrepareConversions.ViewModels;
using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;

Expand Down Expand Up @@ -62,8 +63,18 @@ public async Task<FileStreamResult> OnGetDownload()
}
else
{
return null;
var stream = new MemoryStream();
var writer = new StreamWriter(stream);
writer.Write("");
writer.Flush();
stream.Position = 0;

var fileStreamResult = new FileStreamResult(stream, "text/csv")
{
FileDownloadName = "empty.csv"
};

return fileStreamResult;
}
}

}

0 comments on commit e74fc91

Please sign in to comment.