How to fix problems uploading images in asp.net mvc 3/razor - Digital Tool Factory blog How to fix problems uploading images in asp.net mvc 3/razor - Digital Tool Factory blog

How to fix problems uploading images in asp.net mvc 3/razor

The Problem: You are attempting to create create an asp.net mvc 3 page with razor that uses an upload control.  You try to upload an image and all you get is a “server not available” error.  Not very descriptive it it?

The Cause: ASP.net sets the default upload limit very low.

The Solution: Raise the limit, just add this to the web.config file ,

<httpRuntime maxRequestLength=”9097151″ executionTimeout=”3600″/>

That’s it!

 

This post originally appeared on the Stronico blog – with the absorption of Stronico into Digital Tool Factory this post has been moved to the Digital Tool Factory blog

 

Written By Steve French

 

One response to “How to fix problems uploading images in asp.net mvc 3/razor”

  1. I do not like it. I want to see a Timeout and change things for it (optimize queries, for example).

    In my projects (WebForms), I placed all upload handler in directory with this code. Only upload and similar handlers.

Leave a Reply

Your email address will not be published. Required fields are marked *






Copyright 2011 Digital Tool Factory. All Rights Reserved. Powered by raw technical talent. And in this case, WordPress.