Uploading media stuck at 100%

I recently came across a very interesting problem while trying to work out why a content editor could not upload media in to Sitecore. In the Upload Media dialog we were getting to 100% but then nothing:

Sitecore hangs

Chrome tools is your friend!

Well as it turned out we did have an error when we inspected the console tab of chrome development tools. So what was the error?

Sitecore media error

How did we solve this?

The solution was simple: in the end we just needed to register the component Sitecore.Controllers.MediaController and give it a lifestyle of LifestylePerWebRequest().

We were using Castle Windsor so within the class where we are registering our components we added:


What was the result?

While we are still having issues but we can at least upload media without getting stuck at 100% and the exception being thrown.