Пример #1
0
        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"));
        }
Пример #2
0
        /// <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));
        }