Try our conversational search powered by Generative AI!

Troubleshooting ImageFile upload Failed


I am in need of some smarter brains to help me troubleshoot an issue with an ImageFile upload. I set up an "ImageFile" type, inheriting from ImageData, to be able to add image files to Episerver. The implementation is pretty straight forward:

	[ContentType(DisplayName = "ImageFile", GUID = "4a31542c-b536-47a9-a1f0-9e1e236a06de", Description = "")]
	[MediaDescriptor(ExtensionString = "jpg,jpeg,jpe,ico,gif,bmp,png")]
	public class ImageFile : ImageData {

		public virtual string Copyright { get; set; }

		public virtual string AltText { get; set; }

To upload an image I open the content sidebar, navigate to the Media tab, select a folder, and press + icon to add a new one. When I select an image to upload and hit okay, it goes through the upload process, shows the status bar, and then shows a "Failed" status. Interestingly, the content sidebar refreshes and shows the image, and the log files in App_Data don't show any updates or messages related.

Does anyone have any ideas on this? What can I check? What can I look for?


Apr 12, 2016 22:15

Are you able to create blocks and other media files?

What version are you on? 

Have you recently upgraded episerver?

Checked file access for IIS_IUSERS on folder where blobs are stored? 

Using forms authentication?

Any console errors?

Apr 12, 2016 22:55

Are you able to create blocks and other media files?

  • I can create blocks just fine. I don't have other media files to try right now, as it would be a video. I can locate something and test that.

What version are you on? 

  • Looks like 9.2. Incidentally, is there anything in the interface or web.config to confirm this? Checked NuGet Package Manager to get version.

Have you recently upgraded episerver?

  • Not recently. Did it once or twice before the project started, back in Feb or early March. Not since my current version.

Checked file access for IIS_IUSERS on folder where blobs are stored? 

  • I have ensured the user running the App pool has full permissions. It's not running as IIS_IUSERS. Does that make a difference? I believe the IUSERS account/group has read.

Using forms authentication?

  • Yes - And I am authenticated

Any console errors?

  • Where else would I check, beyond Episerver logs in App_Data folder?
Apr 12, 2016 23:12

If I remember correctly, I think you can hover the "failed" text with your mouse pointer, and you should see a bit more information.

Apr 13, 2016 10:36

Checked access rights for folder in admin so you have access in Episerver for it?

Since you can create blocks it's not that you have wrong id on globalassetsfolder. Forms authentication means that as long as you apppool account have access you should be fine. Code looks good. You are sure you are actually uploading an image with the extension above? :)

Apr 13, 2016 10:45

Ah, the infamous hover. I forgot that some of the fields in Epi have the hover. Thanks for reminding me about it. I got a "timeout or file size exceeded" message on the hover action over the Failed message. I think the hover action should be made a bit more obvious in Epi. That's one of my complaints with the "Description" for properties as well, since your average user won't expect to be able to hover over seemingly plain looking text and get more information.

Now I have something to work off of, though!

Edited, Apr 13, 2016 22:19

I tried setting the max length values in the Web.config per to see if it made a difference, but it hasn't changed anything. Is there anything different with newer versions of Epi?

Edited, Apr 13, 2016 22:38

File size should be the MaxRequestLength attribute on httpruntime element in Web.config...(Still)

Apr 14, 2016 7:42

Hi everyone,

Can you please indicate me where I need to place the code above? I've been having problems uploading images.

I am not quite sure if I have to place the code on the Epi CMS or on the Terminal of my computer (MacBook).

Thanks you in advance!

Mar 21, 2020 16:05

Hi Omar,

Making the assumption that you are asking where you configure the file size limits and not how to create Episerver media content types.

The upload file size is configured in web.config, see this post for example - so it is the web.congif file in your Episerver project.

You need to set the two values

maxRequestLength which is in the system.web -> httpRuntime attribute (can be also set under the location element, to have different limits per location, NOTE! Episerver default web.config has the value set by default to 1000000 in the [locationa path="EPiServer"] (or the UI path you have configured).

maxAllowedContentLength, which is IIS feature configuration in web.config as shown in the above linked blog post. For this to work, you mus have the IIS featre 'Request Filtering' installed, see MS Documentation.

NOTE! These values use different unit! maxRequestLength uses kilobytes and maxAllowedContentLength uses bytes.

So to limit uploads to 100MB

  • maxRequestLength value should be 102 400KB (100MB * 1024)
  • maxAllowedContentLength value should be 104 857 600B (100MB * 1024 * 1024)
Edited, Mar 29, 2020 8:50
* 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.