Upload files larger than 4MB in Optimizely CMS12
In a new version, you would perhaps expect everything to be bigger, better and faster? For Optimizely CMS, that is (for the most part) the case. But when it comes to uploading files in edit mode assets pane, there is a 4MB limit.
If you try uploading a larger file, you will see this error.
And in the browser console, there is a POST request to /EPiServer/CMS/FileUpload/Upload/ that fails with HTTP 413 (Payload Too Large).
So how do we increase the payload limit? Just add the following to in your ConfigureServices
method in Startup.cs
:
services.Configure<UploadOptions>(x =>
{
x.FileSizeLimit = 52428800; // 50MB
});
How do I know this? I struggled, and asked for help on the Optimizely World Forum. The OMVPs Ted Nyberg and Chris Sharp came to the rescue. Thanks!