PdfRpt.Core.Helper.SoftHttpContext.addHeaders C# (CSharp) Méthode

addHeaders() private static méthode

private static addHeaders ( string fileName, long fileLength, object response, FlushType flushType ) : void
fileName string
fileLength long
response object
flushType FlushType
Résultat 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 });
        }