PdfRpt.Core.Helper.SoftHttpContext.FlushInBrowser C# (CSharp) Method

FlushInBrowser() public static method

Flushes the fileData into the user's browser. It's designed for the ASP.NET Applications.
public static FlushInBrowser ( string fileName, byte fileData, FlushType flushType = FlushType.Attachment ) : void
fileName string name of the file
fileData byte byte array containing the file's data
flushType FlushType How to flush an in memory PDF file
return void
        public static void FlushInBrowser(string fileName, byte[] fileData, FlushType flushType = FlushType.Attachment)
        {
            var fileLength = fileData.Length;

            var context = getCurrentHttpContext();
            var response = getCurrentResponse(context);
            setNoCache(response);
            setContentType(response);
            addHeaders(fileName, fileLength, response, flushType);
            setBufferTrue(response);
            clearResponse(response);
            writeToOutputStream(fileData, fileLength, response);
            responseEnd(response);
        }