Try our conversational search powered by Generative AI!

Problem changing file upload limit beyond 500mb



I need to be able to upload big files in our optimizely-site, and successfully managed to change the limit to 400mb. However, when I increased it again to 600mb it wont accept files of that size, and says "File too big" error. (Im doing the upload in the CMS-editor so its not the users themselves doing them).

Version: 12.15.0

The change I did to make 400mb files work was adding this to startup.cs:

services.Configure<UploadOptions>(x =>
                x.FileSizeLimit = 629145600; // 600MB, (<------- not working, it worked when this was 400mb max

            services.Configure<FormOptions>(x =>
                x.ValueLengthLimit = int.MaxValue;
                x.MultipartBodyLengthLimit = int.MaxValue; // In case of multipart

Is there a hard limit to 500mb somewhere? It doesnt seem to be a timeout either, because the upload takes around 50s

Any ideas?



May 17, 2023 12:07

This setting configured the IHttpMaxRequestBodySizeFeature which allow NULL for unlimited. Can you try setting it to NULL? If this has the same issue I'd expect it's likely something set on the server level. Are you on the DXP or self hosting?

// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace Microsoft.AspNetCore.Http.Features
    /// <summary>
    /// Feature to inspect and modify the maximum request body size for a single request.
    /// </summary>
    public interface IHttpMaxRequestBodySizeFeature
        /// <summary>
        /// Indicates whether <see cref="MaxRequestBodySize"/> is read-only.
        /// If true, this could mean that the request body has already been read from
        /// or that <see cref="IHttpUpgradeFeature.UpgradeAsync"/> was called.
        /// </summary>
        bool IsReadOnly { get; }

        /// <summary>
        /// The maximum allowed size of the current request body in bytes.
        /// When set to null, the maximum request body size is unlimited.
        /// This cannot be modified after the reading the request body has started.
        /// This limit does not affect upgraded connections which are always unlimited.
        /// </summary>
        /// <remarks>
        /// Defaults to the server's global max request body size limit.
        /// </remarks>
        long? MaxRequestBodySize { get; set; }
May 18, 2023 11:44

I found this forum thread with some things to try as well. Looks like on DXP there was a blocker coming from Cloudflare in this case, might be worth opening a ticket with Optimizely if your DXP

May 18, 2023 11:51
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.