Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jeff Kwong 31 posts 51 karma points
    Jan 10, 2011 @ 06:05
    Jeff Kwong
    0

    No File Upload Limit in web.config

    I have a new 4.5 installation, and I need to increase the file upload limit.  Looking under <system.web> I don't see a  "httpRuntime maxRequestLength" entry and adding it I get a server error.  This hasn't been an issue on past sites I've built using Umbraco.  Am I the only one having this problem?

  • Sebastiaan Janssen 5045 posts 15478 karma points MVP admin hq
    Jan 10, 2011 @ 08:19
    Sebastiaan Janssen
    0

    Yes, it's not there for me either, but that's not a problem as it is set at the server level anyway.

    I added the property but it works perfectly. did you get the casing right?

    <httpRuntime requestValidationMode="2.0" maxRequestLength="4000"/>

  • Jeff Kwong 31 posts 51 karma points
    Jan 10, 2011 @ 09:12
    Jeff Kwong
    0

    Hmm, I added the following which return the server error:

    <httpRuntime maxRequestLength="1048576" executionTimeout="3600" />

    I tried yours as well with the same result.  I'm pretty sure I'm putting it in the right place:

      <system.web>
      <httpRuntime requestValidationMode="2.0" maxRequestLength="4000"/>
    <!--    <httpRuntime maxRequestLength="1048576" executionTimeout="3600" />-->
        <!-- <trust level="Medium" originUrl=".*" />-->
        <customErrors mode="Off" />...

     

  • Sebastiaan Janssen 5045 posts 15478 karma points MVP admin hq
    Jan 10, 2011 @ 09:30
    Sebastiaan Janssen
    0

    So, what is the exact exception that you get?

  • Jeff Kwong 31 posts 51 karma points
    Jan 10, 2011 @ 19:16
    Jeff Kwong
    0

    I'm getting a 500 Internal Server Error.

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Jan 10, 2011 @ 20:14
    Dirk De Grave
    0

    Jeff,

    Check your windows log using event viewer and see the details of the error, may give a clue?

     

    Cheers,

    /Dirk

  • Jeff Kwong 31 posts 51 karma points
    Jan 10, 2011 @ 23:05
    Jeff Kwong
    0

    Sadly, I don't have access to the event viewer on the server, and it's a shared server so increasing the max upload size server-wide isn't an option.

  • Ravi Motha 290 posts 500 karma points MVP 7x c-trib
    Jan 11, 2011 @ 00:34
    Ravi Motha
    0

    Hi Jeff,

    If you are on a shared server, I would ask whomever controls the environment if you can increase the size of the file uploads (if you don't ask you don't get), at the very least you should be given what the filesize limit is.

    From there you can make a choice about what your next steps. eg changing any file uploads to be smaller etc

     

     

  • Aaron Powell 1708 posts 3046 karma points c-trib
    Jan 11, 2011 @ 02:41
    Aaron Powell
    0

    Is the error a YSOD (yellow screen of death) or an error in big lettering? 

    If it's the former then it's most likely a problem either with the code handling the upload or the app pool user (ie - Network Service) doesn't have enough access to save the file to the required folder.

    If it's the latter you will need more information from a server administrator. The event logs will help narrow down the root of the problem (again it's most likely permissions though).

    For peoples reference the default max upload size is 4Mb - http://msdn.microsoft.com/en-us/library/e1f13641.aspx and it's not set in the machine.config (or aspnet.config) but in the source of the HttpRuntimeSection class in the .NET framework

  • Jeff Kwong 31 posts 51 karma points
    Jan 11, 2011 @ 07:37
    Jeff Kwong
    0

    Thanks for all your help.  Turns out I'm a Grade A moron.  I didn't notice this further down the page: <httpRuntime requestValidationMode="2.0"/>.  I'm used to seeing it just below <system.web> and had done a search for "maxRequestLength" rather than "httpRuntime."  Works fine now.  What a dope.

Please Sign in or register to post replies

Write your reply to:

Draft