|
1 | 1 | using System; |
2 | 2 | using System.Collections.Generic; |
3 | 3 | using System.IO; |
4 | | -using System.Reflection; |
5 | 4 | using System.Net; |
6 | 5 | using System.Threading.Tasks; |
7 | 6 | using GeneXus.Configuration; |
8 | 7 | using GeneXus.Http; |
9 | 8 | using GeneXus.HttpHandlerFactory; |
10 | 9 | using GeneXus.Services; |
11 | 10 | using GeneXus.Utils; |
12 | | -using GxClasses.Helpers; |
13 | 11 | using GxClasses.Web.Middleware; |
14 | 12 | using log4net; |
15 | 13 | using Microsoft.AspNetCore; |
|
18 | 16 | using Microsoft.AspNetCore.Diagnostics; |
19 | 17 | using Microsoft.AspNetCore.Hosting; |
20 | 18 | using Microsoft.AspNetCore.Http; |
| 19 | +using Microsoft.AspNetCore.Http.Features; |
21 | 20 | using Microsoft.AspNetCore.Mvc; |
22 | 21 | using Microsoft.AspNetCore.Rewrite; |
23 | 22 | using Microsoft.AspNetCore.Routing; |
@@ -95,6 +94,7 @@ public class Startup |
95 | 94 |
|
96 | 95 | static readonly ILog log = log4net.LogManager.GetLogger(typeof(Startup)); |
97 | 96 | const int DEFAULT_SESSION_TIMEOUT_MINUTES = 20; |
| 97 | + const int DEFAULT_MAX_FILE_UPLOAD_SIZE_BYTES = 500000000; |
98 | 98 | public static string VirtualPath = string.Empty; |
99 | 99 | public static string LocalPath = Directory.GetCurrentDirectory(); |
100 | 100 |
|
@@ -144,6 +144,10 @@ public void ConfigureServices(IServiceCollection services) |
144 | 144 | AppSettings settings = new AppSettings(); |
145 | 145 | Config.ConfigRoot.GetSection("AppSettings").Bind(settings); |
146 | 146 |
|
| 147 | + services.Configure<FormOptions>(options => |
| 148 | + { |
| 149 | + options.MultipartBodyLengthLimit = settings.MaxFileUploadSize==0 ? DEFAULT_MAX_FILE_UPLOAD_SIZE_BYTES : settings.MaxFileUploadSize; |
| 150 | + }); |
147 | 151 | ISessionService sessionService = GXSessionServiceFactory.GetProvider(); |
148 | 152 |
|
149 | 153 | if (sessionService != null) |
|
0 commit comments