diff --git a/dotnet/src/dotnetframework/GxClasses/Model/GXWebProcedure.cs b/dotnet/src/dotnetframework/GxClasses/Model/GXWebProcedure.cs index fc01e6f12..295e553e0 100644 --- a/dotnet/src/dotnetframework/GxClasses/Model/GXWebProcedure.cs +++ b/dotnet/src/dotnetframework/GxClasses/Model/GXWebProcedure.cs @@ -6,6 +6,7 @@ namespace GeneXus.Procedure using System.Globalization; using GeneXus.Http; using GeneXus.Mime; + using System.Net.Mime; #if NETCORE using Microsoft.AspNetCore.Http; #else @@ -14,6 +15,7 @@ namespace GeneXus.Procedure public class GXWebProcedure : GXHttpHandler { + static readonly IGXLogger log = GXLoggerFactory.GetLogger(); protected int handle; protected GXReportMetadata reportMetadata; @@ -137,8 +139,19 @@ private void setOuputFileName() { fileType = outputType.ToLower(); } - - context.HttpContext.Response.AddHeader(HttpHeader.CONTENT_DISPOSITION, $"inline; filename={fileName}.{fileType}"); + try + { + ContentDisposition contentDisposition = new ContentDisposition + { + Inline = true, + FileName = $"{fileName}.{fileType}" + }; + context.HttpContext.Response.AddHeader(HttpHeader.CONTENT_DISPOSITION, contentDisposition.ToString()); + } + catch (Exception ex) + { + GXLogging.Warn(log, $"{HttpHeader.CONTENT_DISPOSITION} couldn't be set for {fileName}.{fileType}", ex); + } } } @@ -152,9 +165,9 @@ protected bool initPrinter(String output, int gxXPage, int gxYPage, String iniFi if (!Config.GetValueOf("LANGUAGE", out idiom)) idiom = "eng"; fileContentInline = true; -#if NETCORE + setOuputFileName(); -#endif + getPrinter().GxRVSetLanguage(idiom); int xPage = gxXPage; int yPage = gxYPage;