diff --git a/Program.cs b/Program.cs index 74aa8d1..ca13cd0 100644 --- a/Program.cs +++ b/Program.cs @@ -1,4 +1,5 @@ using Infostacker.Services; +using Microsoft.AspNetCore.Http.Features; using Microsoft.Extensions.DependencyInjection.Extensions; using Serilog; using Serilog.Core; @@ -34,6 +35,12 @@ .AllowAnyMethod(); }); }); + +builder.Services.Configure(options => +{ + options.MultipartBodyLengthLimit = 104857600; // 100MB +}); + builder.Services.AddTransient(); builder.Services.TryAddSingleton(); builder.Logging.ClearProviders(); diff --git a/Services/SharingService.cs b/Services/SharingService.cs index cfbd9dd..5d19cb8 100644 --- a/Services/SharingService.cs +++ b/Services/SharingService.cs @@ -27,6 +27,8 @@ public SharingService(ILogger logger, IConfiguration configurati TemplateScriptPath = _configuration.GetSection("TemplateScriptPath").Value ?? string.Empty; BuildVersion = _configuration.GetSection("version").Value ?? string.Empty; MaxFileSize = int.Parse(_configuration.GetSection("MaxFileSizeInBytes").Value); + + } public async Task UploadMarkdownWithFiles(string markdown, List files) diff --git a/appsettings.json b/appsettings.json index efef553..6ccc043 100644 --- a/appsettings.json +++ b/appsettings.json @@ -9,7 +9,7 @@ "AdobeAPIToken": "", "TemplatePath": "template.html", "TemplateScriptPath": "templateScript.html", - "MaxFileSizeInBytes": 26214400, + "MaxFileSizeInBytes": 104857600, "AllowedHosts": "*", "SeqServer": "" } diff --git a/iisexpress-web.config b/iisexpress-web.config new file mode 100644 index 0000000..0423ad7 --- /dev/null +++ b/iisexpress-web.config @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sample-web.config b/sample-web.config index ecad5b3..825960c 100644 --- a/sample-web.config +++ b/sample-web.config @@ -1,30 +1,55 @@ - - - - - + + + + + + - - - - - + + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file