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

addHeaders() private static method

private static addHeaders ( string fileName, long fileLength, object response, FlushType flushType ) : void
fileName string
fileLength long
response object
flushType FlushType
return void
        private static void addHeaders(string fileName, long fileLength, object response, FlushType flushType)
        {
            var addHeader = response.GetType().GetMethod("AddHeader");
            addHeader.Invoke(response, new object[] { "Content-Length", fileLength.ToString(CultureInfo.InvariantCulture) });
            var contentDisposition = flushType == FlushType.Inline ? "inline;filename=" : "attachment;filename=";
            addHeader.Invoke(response, new object[] { "content-disposition", contentDisposition + fileName });
        }