public async Task <IActionResult> Download(int id) { if (id <= 0) { return(new BadRequestObjectResult(new Response("Invalid analysis id."))); } var stream = new MemoryStream(); await _analysisService.ArchiveAnalysis(id, stream); return(File(stream, "application/zip", $"Analysis {id}.zip")); }