public IActionResult FileStream(bool fileName, bool etag) { string webRoot = this.hostingEnvironment.WebRootPath; FileStream stream = System.IO.File.OpenRead(Path.Combine(webRoot, "TestFile.txt")); ResumingFileStreamResult result = this.ResumingFile(stream, "text/plain", fileName ? "TestFile.txt" : null, etag ? EntityTag : null); result.LastModified = this.lastModified; return(result); }
public IActionResult FileStream(bool fileName) { string webRoot = this.hostingEnvironment.WebRootPath; FileStream stream = System.IO.File.OpenRead(Path.Combine(webRoot, "TestFile.txt")); var result = new ResumingFileStreamResult(stream, "text/plain") { FileInlineName = "TestFile.txt", LastModified = this.lastModified }; return(result); }