diff --git a/Intersect.Server/Web/Controllers/Api/EditorUpdatesController.cs b/Intersect.Server/Web/Controllers/Api/EditorUpdatesController.cs index 56721fdb39..8aec6079e8 100644 --- a/Intersect.Server/Web/Controllers/Api/EditorUpdatesController.cs +++ b/Intersect.Server/Web/Controllers/Api/EditorUpdatesController.cs @@ -7,6 +7,7 @@ using Intersect.Server.Web.Http; using Intersect.Server.Web.Types; using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Http.Features; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Options; @@ -54,12 +55,15 @@ IOptionsMonitor updateServerOptionsMonitor /// Optional subfolder within assets/client (e.g., "resources", "resources/images") /// Upload results for each file [HttpPost("client")] + [Consumes("multipart/form-data")] + [DisableRequestSizeLimit] + [RequestFormLimits(MultipartBodyLengthLimit = long.MaxValue, ValueLengthLimit = int.MaxValue)] [ProducesResponseType(typeof(UploadResponse), (int)HttpStatusCode.OK, ContentTypes.Json)] [ProducesResponseType(typeof(UploadResponse), (int)HttpStatusCode.MultiStatus, ContentTypes.Json)] [ProducesResponseType(typeof(ErrorResponse), (int)HttpStatusCode.BadRequest, ContentTypes.Json)] [ProducesResponseType(typeof(ErrorResponse), (int)HttpStatusCode.Forbidden, ContentTypes.Json)] public async Task UploadClientFiles( - [FromForm] string? subfolder = null + [FromQuery] string? subfolder = null ) { return await UploadFilesInternal("client", Request.Form.Files, subfolder); @@ -73,12 +77,15 @@ public async Task UploadClientFiles( /// Optional subfolder within assets/editor /// Upload results for each file [HttpPost("editor")] + [Consumes("multipart/form-data")] + [DisableRequestSizeLimit] + [RequestFormLimits(MultipartBodyLengthLimit = long.MaxValue, ValueLengthLimit = int.MaxValue)] [ProducesResponseType(typeof(UploadResponse), (int)HttpStatusCode.OK, ContentTypes.Json)] [ProducesResponseType(typeof(UploadResponse), (int)HttpStatusCode.MultiStatus, ContentTypes.Json)] [ProducesResponseType(typeof(ErrorResponse), (int)HttpStatusCode.BadRequest, ContentTypes.Json)] [ProducesResponseType(typeof(ErrorResponse), (int)HttpStatusCode.Forbidden, ContentTypes.Json)] public async Task UploadEditorFiles( - [FromForm] string? subfolder = null + [FromQuery] string? subfolder = null ) { return await UploadFilesInternal("editor", Request.Form.Files, subfolder);