public IActionResult FileContent(bool fileName, bool etag) { string webRoot = _hostingEnvironment.WebRootPath; var content = System.IO.File.ReadAllBytes(Path.Combine(webRoot, "TestFile.txt")); ResumeFileContentResult result = this.ResumeFile(content, "text/plain", fileName ? "TestFile.txt" : null, etag ? EntityTag : null); result.LastModified = _lastModified; return(result); }
public IActionResult FileContent(bool fileName) { string webRoot = _hostingEnvironment.WebRootPath; var content = System.IO.File.ReadAllBytes(Path.Combine(webRoot, "TestFile.txt")); var result = new ResumeFileContentResult(content, "text/plain") { FileInlineName = "TestFile.txt", LastModified = _lastModified }; return(result); }