November Happy Hour will be moved to Thursday December 5th.

File size limit CMS 12

Vote:
 

We want to import multiple websites/media folders into one CMS instance, and have increased the max filesize using the appsettings:

    "CmsUI": {
      "Upload": {
        "FileSizeLimit": 10737418240
      },

And using:

            services.Configure<FormOptions>(x =>
            {
                x.MultipartBodyLengthLimit = 10737418240;
            });

This seems to work for our local development environment, but when trying to do the same in DXP, we still get a 'Timed out, or max file size exceeded' error after about a minute. The file were trying to upload is around 1gb.

Theres this bug: https://world.optimizely.com/support/bug-list/bug/CMS-24180. But its stated this has been fixed in 12.10.0. We are using 12.13.1.

Are there any settings we missed that make it work in DXP?

#290913
Edited, Nov 01, 2022 12:59
Vote:
 

It sounds to me that this is because of the request time out, not size limitation. Could you increase the time out setting? 

#290914
Nov 01, 2022 13:44
Vote:
 

Ill give it a shot, but I'm not sure if thatll work. I've tried a different file (media folder vs pages), this one gave the same error but after 4+ minutes instead of 55 seconds. Both were around 900mb/1gb.

Do you know which setting needs to be changed for the timeout?

#290915
Nov 01, 2022 13:47
Vote:
 

Hmm. That's strange. Default timeout is like 110s if IIRC. 

Could you upload something like 100MB and succeeded?

#290917
Nov 01, 2022 14:21
Vote:
 

Ive tried a 380mb file which took 1.5min and succeeded. I then tried a 530mb file, which failed after 20sec 40sec, 2min and 4min.

#290920
Edited, Nov 01, 2022 15:18
Vote:
 

Could you enable debug logs on DXP and try to import. it should show better error message. Something like "[18:24:25 DBG] Connection id "..." bad request data: "Request body too large. The max request body size is 20971520 bytes." followed by the stack trace.

#290923
Nov 01, 2022 16:51
Vote:
 

You need to set the max size for kestrel as well.

public static IHostBuilder CreateHostBuilder(string[] args) =>
    Host.CreateDefaultBuilder(args)
        .ConfigureWebHostDefaults(webBuilder =>
        {
            webBuilder.ConfigureKestrel((context, options) =>
            {
                // Handle requests up to 50 MB
                options.Limits.MaxRequestBodySize = 52428800;
            })
            .UseStartup<Startup>();
        });

https://learn.microsoft.com/en-us/aspnet/core/mvc/models/file-uploads?view=aspnetcore-6.0

#290924
Nov 01, 2022 16:53
Vote:
 

That doesnt make sense, since a file of 300mb was uploaded fine, and the default size is 30mb. I've added the setting anyway and it still fails for large files.

So far, Ive added the following settings:

Program.cs (tried both usekestrel and configurekestrel):

webBuilder.ConfigureKestrel((context, options) =>
{
    options.Limits.MaxRequestBodySize = 107374182400;
})

Startups.cs:

services.Configure<FormOptions>(x => { x.MultipartBodyLengthLimit = 107374182400; });

Appsettings.json:

  "EPiServer": {
    "CmsUI": {
      "Upload": {
        "FileSizeLimit": 107374182400
      }
    }
  }
#290977
Nov 02, 2022 9:52
Vote:
 
    "CmsUI": {
      "Upload": {
        "FileSizeLimit": 10737418240
      },

Not sure it'll solve your problem, but shouldn't "Upload" be "UploadOptions" here?

https://docs.developers.optimizely.com/content-cloud/v12.0.0-content-cloud/docs/cmsui-section-replace-when-cms-22234-goes-out#uploadoptions

#291231
Nov 07, 2022 20:56
Chris Sharp - Nov 08, 2022 2:47
No... "Upload" is correct here.
Vote:
 

Was this issue Resolved? 
We are facing same issue, where we have updated appsettings, Startup to add 'MultipartBodyLengthLimit' and Kestrel (Program.cs). But nothing seems to work...Still seeing 'Timeout exceeded..' msg

#294952
Jan 18, 2023 23:32
QuirijnLangedijk - Jan 19, 2023 14:23
Yes, we were able to resolve this after a lot of talking with Epi Support, they changed certain Cloudflare settings which let them work in the DXP environments
Manish - Jan 19, 2023 14:25
We will follow-up with support. Thank you so much for the update.
Vote:
 

Any updates on this issue?

#297700
Mar 04, 2023 9:50
Vote:
 

We were able to resolve this issue by contacting support. They increased a certain limit in Cloudflare, which allowed us to import the files in DXP.

#297791
Mar 06, 2023 8:40
Vote:
 

We simply added the CmsUI section with UploadOptions set to 10 MB instead of default 4 MB, and got it to work like this for using EPiServer.CMS 12.27.1:

"EPiServer": {
  "CmsUI": {
    "UploadOptions": {
      "FileSizeLimit": 10485760 // 10 MB
    }
  }
#319869
Edited, Apr 02, 2024 9:10
Vote:
 

Below are the options I use. We haven't heard any complaints about large files but the use case probably differs.

Program.cs

webBuilder.ConfigureKestrel((context, options) =>
{
	options.Limits.MaxRequestBodySize = 100000000;
	options.AllowSynchronousIO = true; //This defaults to false, which causes large media folders in media widget not to load.
});

Startup.cs

services.Configure<FormOptions>(x =>
{
    x.MultipartBodyLengthLimit = 100000000;
})
.Configure<UploadOptions>(x =>
{
    x.FileSizeLimit = 100000000;
})
#319992
Edited, Apr 04, 2024 11:31
Vote:
 

We faced a similar issue with a client.

The code and configuration solutions above fix the issue to a certain extent, but you will face a limit with Cloudflare if you are uploading extremely large files.  I can not remember the exact limit, but in our case, we wanted to upload a file that was ~750MB.  To get this to work we needed to contact support and get them to increase the limit within Cloudflare.

#320054
Apr 05, 2024 9:07
* 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.