diff --git a/Dfe.PrepareConversions/Dfe.PrepareConversions/Pages/ProjectList/Index.cshtml.cs b/Dfe.PrepareConversions/Dfe.PrepareConversions/Pages/ProjectList/Index.cshtml.cs index cc20b185f..549620cae 100644 --- a/Dfe.PrepareConversions/Dfe.PrepareConversions/Pages/ProjectList/Index.cshtml.cs +++ b/Dfe.PrepareConversions/Dfe.PrepareConversions/Pages/ProjectList/Index.cshtml.cs @@ -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; @@ -62,8 +63,18 @@ public async Task 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; } } - }