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

Exception thrown in EPiServer.Cms.Shell.Service.Internal.ContentService.SaveMedia

Vote:
 

Hi all, 

When we replaced an image in the CMS, we kept seeing an error:

"Timed out, or max file size exceeded"

We investigated all the solutions available online, but nothing worked. 

Eventually we decompiled your code and found that an exception is thrown when you try to cast IContentMedia to IContent: 

https://i.imgur.com/JSEDOrg.png

This only happens when we replace an image. Not when we upload a new image. 

Steps to reproduce: 

  1. Be on Episerver 11
  2. Upload an image
  3. Upload an image with the same name

Expected: 

Image should upload with no error

Actual: 

"Timed out, or max file size exceeded"

Any ideas on a solution? 

#194571
Edited, Jun 25, 2018 17:20
Vote:
 

I can verify that on clean Alloy (v11.7) replace of the image works as expected.

Do you have any custom handlers or anything that might mess around this operation?

#194629
Jun 26, 2018 20:17
Vote:
 

We removed all custom handlers and the problem persisted. In the end, we circumvented the issue by adding cache-busting so each image name was unique and avoided the rename issue. 

#195021
Jul 11, 2018 12:39
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* 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.