public async Task <ActionResult> BOM(string projectName, string hash, string token = null) { string localFileName = await _userResolver.EnsureLocalFile(projectName, LocalName.BOM, hash); var bom = Json.DeserializeFile <ExtractedBOM>(localFileName); string csv = bom.ToCSV(); // BOM size is small, so ignore potential performance improvements with direct stream writing var stream = new MemoryStream(Encoding.UTF8.GetBytes(csv)); return(File(stream, "text/csv", "bom.csv")); }
/// <summary> /// Send local file for the project. /// </summary> private async Task <ActionResult> SendLocalFileContent(string projectName, string fileName, string hash = null, string contentType = "application/json") { string localFile = await _userResolver.EnsureLocalFile(projectName, fileName, hash); return(new PhysicalFileResult(localFile, contentType)); }