From 2a13d8d2e58b6e8ac607ea033315ae82e0f07014 Mon Sep 17 00:00:00 2001 From: Ognjen Cirkovic Date: Sun, 10 Apr 2022 21:46:35 +0200 Subject: Omoguceno uplodovanje velikih fajlova. --- backend/api/api/Controllers/FileController.cs | 1 + backend/api/api/Program.cs | 6 ++++++ 2 files changed, 7 insertions(+) (limited to 'backend/api') diff --git a/backend/api/api/Controllers/FileController.cs b/backend/api/api/Controllers/FileController.cs index ad788e17..7ed16669 100644 --- a/backend/api/api/Controllers/FileController.cs +++ b/backend/api/api/Controllers/FileController.cs @@ -130,6 +130,7 @@ namespace api.Controllers [HttpPost("Csv")] [Authorize(Roles = "User,Guest")] + [DisableRequestSizeLimit] public async Task> CsvUpload([FromForm]IFormFile file) { diff --git a/backend/api/api/Program.cs b/backend/api/api/Program.cs index 7d5d0c45..43fd5cd6 100644 --- a/backend/api/api/Program.cs +++ b/backend/api/api/Program.cs @@ -4,6 +4,7 @@ using api.Interfaces; using api.Models; using api.Services; using Microsoft.AspNetCore.Authentication.JwtBearer; +using Microsoft.AspNetCore.Http.Features; using Microsoft.Extensions.Options; using Microsoft.IdentityModel.Tokens; using MongoDB.Driver; @@ -55,6 +56,11 @@ builder.Services.AddAuthentication( }; }); +builder.Services.Configure(x => +{ + x.ValueLengthLimit = int.MaxValue; + x.MultipartBodyLengthLimit = int.MaxValue; +}); builder.Services.AddControllers(); -- cgit v1.2.3