Optimizely CMS 12 – Unable to Import Data

Are you unable to import data from another instance? If you are getting a non-explanatory error message “No file uploaded” when you click on “Upload and Verify File” or “Begin Import”, this post will help you.

I exported some content items from a lower environment and I wanted to import them to an upper environment, and the file size was 51,950 KB. I was getting that error without any indication or any record on the logs. While I was searching for a solution, I found a precise article written by Tomas Hensrud Gulla where he explains how to resolve an issue when trying to upload files to the Media assets.

By default, the new version 12 comes with a size limit when uploading files which is 4194304 bytes = 4 MB. This configuration prevents storing files more than this limit.

In order to increment the size of this limitation, in the startup class, add the following configuration:

public void ConfigureServices(IServiceCollection services)
   services.Configure<UploadOptions>(x =>
       x.FileSizeLimit = 62914560; 

Where 62914560 bytes = 60 MB. I used this helpful page to convert from MB to bytes.

Once I deployed the change to the environment, I was able to upload and verify the file correctly:

Hope this helps! 🙂

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: