Copied to clipboard

Flag this post as spam?

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


  • Pat 12 posts 33 karma points
    Aug 07, 2012 @ 21:21
    Pat
    0

    Friendly error message for files that exceed size limit

    I'm looking for the best approach to displaying a friendly error message when a file exceeds a size limit when uploading a file in the media section.

    Right now, if a file is larger then what is set in the web.config (2MB) it will display a 404 error message.

    I don't think modifying <error404> in umbraco.config will work since the custom error message would display for all 404 errors.

    Right now I'm thinking I may have to dl the source and check in code. I'm hoping there is an easier way?

  • Jordy Vialoux 73 posts 103 karma points
    Aug 08, 2012 @ 05:33
    Jordy Vialoux
    0

    I have just run into the same issue - I need to upload PDFs that are over 2mb ( probably up to 20mb )

    Pretty sure you change this in the web config as in maxRequestLength but I can't find this within the system.web section - am running umbraco 4.7.2

    Will be watching this thread like a hawk! 

  • Nigel Wilson 945 posts 2077 karma points
    Aug 08, 2012 @ 06:25
  • Pat 12 posts 33 karma points
    Aug 08, 2012 @ 13:46
    Pat
    1

    Jordy - That's actually not the problem I've run into.

    You are right that you can set the limit in the web.config (this isn't an umbraco related issue), just that for me it will display a 404 error message if the limit is exceeded. I need something that looks prettier and more informative.

    There are 2 settings in the web.config that you may need to adjust. The max size is 2GB with asp.net 2.0 and higher (1GB with asp.net 1).

    Taking the settings below, the one with the smallest size set will take priority.

    This method is in KB and is supported for asp.net:

    <system.web>
        <httpRuntime maxRequestLength="1048576" requestValidationMode="2.0"/>
    </system.web>

     

    This is in BYTES and is supported for IIS:

    <system.webServer>
        <security>
            <requestFiltering>
                    <requestLimits maxAllowedContentLength="1048576" />
            </requestFiltering>
        </security>
    </system.webServer>

    I grabbed this info from a bunch of different sources on the net, hopefully having everything in one place will help people.

  • Jordy Vialoux 73 posts 103 karma points
    Aug 08, 2012 @ 23:11
    Jordy Vialoux
    0

    Hey guys,

    Thanks for the info however, I am running umbraco 4.7.2 as stated above - I am looking for these statements within my web config and I cannot find anything that looks anything like the code snippets you have provided.

    I think it may be worth me creating a new thread as I don't want to complicate results and comments regarding the initial thread issue. 

    If you guys have any further information / ideas that may help please let me know! I've been online looking for this for a while now and cannot find anything.

    Jordy

  • Pat 12 posts 33 karma points
    Aug 09, 2012 @ 01:41
    Pat
    0

    If you can't find them in your web.config then you'll have to add them. I updated my last post to hopefully help you better.

    Don't worry about complicating this thread, I figure if no one has answered by now then no one will be able to help me :(

Please Sign in or register to post replies

Write your reply to:

Draft