Copied to clipboard

Flag this post as spam?

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


  • Ruder Partap Singh 28 posts 142 karma points
    Jul 16, 2022 @ 12:54
    Ruder Partap Singh
    0

    How to increase media upload size in backoffice umbraco 9

    Hi

    I am trying to upload a zip file in media section in umbraco backoffice with size of 62 MB, but getting error. My application is host on IIS and i've added the web.config with

     <?xml version="1.0"?>
    <configuration>
        <system.webServer>
            <security>
                <requestFiltering>
                    <!-- ~ Below is the number of bytes allowed, 4GB is the maximum -->
                    <requestLimits maxAllowedContentLength="1024000000"/>
                </requestFiltering>
            </security>
        </system.webServer>
    </configuration>    
    

    but still getting below error enter image description here

    also updated the value in app.settings

     "Runtime": {
            "MaxRequestLength": 1024000000
          }
    

    but still no luck,

    my umbraco version is 9.5.2 am i missing any configuration or any one can help?

    Thanks

  • Huw Reddick 1929 posts 6697 karma points MVP 2x c-trib
    Jul 16, 2022 @ 14:41
    Huw Reddick
    0

    Does it upload small files ok?

    Seems a weird error to throw for a file size issue

  • Ruder Partap Singh 28 posts 142 karma points
    Jul 16, 2022 @ 14:49
    Ruder Partap Singh
    0

    adding below code to web.config works

    <system.web>
            <httpRuntime requestValidationMode="2.0" enableVersionHeader="false"  maxRequestLength="1024000000" executionTimeout="240" fcnMode="Single" />
        </system.web>
    
  • Andrey Karandashov 23 posts 215 karma points c-trib
    Jul 18, 2022 @ 06:20
  • Niels Lynggaard 192 posts 550 karma points
    Jan 03, 2023 @ 11:39
    Niels Lynggaard
    0

    I'm trying to get this to work on Umbraco 10 on Azure and it doesn't seem to work as expected.

    Documentation states that if nothing is set, then there's no limit, but that doesn't seem to be the case, it seems the limit is somewhere around 60 Mb.

    I tried setting this in appsettings.config as per documentation, but the console still says "The page was not displayed because the request entity is too large" as the OP post.

    I even tried adding these settings to the auto-generated web.config in azure, but that doesn't help either.

    I also found this issue in the issue-tracker(https://github.com/umbraco/Umbraco-CMS/issues/12239) where it seems both methods (appsettings.config and web.config) is needed to get it to work, but so far no luck..

    Any ideas?

  • David Zweben 268 posts 754 karma points
    Jan 03, 2023 @ 21:42
    David Zweben
    0

    As crazy as it sounds, I believe this is actually a .NET and Azure App Service issue, not an Umbraco issue. The "request entity is too large" error is from .NET itself, and in my testing I didn't find a way to adjust the settings via Web.config on Azure App Service. I'm still looking for a way around this. In my case, I was trying to provide a large download, but I believe the same limitation is at play for uploads here.

    Changing the config seems to have worked for some people, though, so maybe try once more and restart the application manually afterward.

  • fatmazayed 41 posts 122 karma points
    Jun 08, 2023 @ 13:11
    fatmazayed
    0

    same issue for me , i tried to remove azuer storage and try upload file with size 60 MB it works fine in localhost but online no

  • fatmazayed 41 posts 122 karma points
    Jun 08, 2023 @ 14:00
    fatmazayed
    0

    i tried that solution adding web config

     <configuration>
      <system.webServer>
      <security>
        <requestFiltering>
          <requestLimits maxAllowedContentLength="99999999" />
        </requestFiltering>
      </security>
      </system.webServer>
    </configuration>
    
  • Huw Reddick 1929 posts 6697 karma points MVP 2x c-trib
    Jun 08, 2023 @ 14:07
    Huw Reddick
    0

    have you also tried adding maxRequestLength ?

  • Huw Reddick 1929 posts 6697 karma points MVP 2x c-trib
    Jun 08, 2023 @ 14:11
    Huw Reddick
    0

    I also think your maxAllowedContentLength is not correct, the value is in bytes so you have set it to 10MB (roughly)

    Web.Config/system.web/httpRuntime/maxRequestLength (in kilobytes)

    Unit of measurement: kilobytes

    Default value 4096 KB (4 MB)

    Max. value 2147483647 KB (2 GB)


    Web.Config/system.webServer/security/requestFiltering/requestLimits/maxAllowedContentLength (in bytes)

    Unit of measurement: bytes

    Default value 30000000 bytes (28.6 MB)

    Max. value 4294967295 bytes (4 GB)

  • Paria Shiri 36 posts 109 karma points
    Jun 08, 2023 @ 15:20
    Paria Shiri
    0

    I had this issue before, I added web.config like this:

    ps: u may don't have web.config at all needs to be added manually mine didn't exist before I added it myself.

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
        <system.webServer>
        <security>
            <requestFiltering>
                <!-- Handle requests up to 1 GB -->
                <requestLimits maxAllowedContentLength="1073741824" />
            </requestFiltering>
        </security>
    </system.webServer>
    </configuration>
    

    Also in my UmbracoAuthorizedJsonController, I added this code to my Action:

    [HttpPost]
    [RequestFormLimits(ValueLengthLimit = int.MaxValue, MultipartBodyLengthLimit = Int64.MaxValue)]
    public async Task UploadFile(.....)
    

    I am using Umbraco 10.

    I hope it helps you!

  • David Armitage 508 posts 2078 karma points
    Apr 04, 2024 @ 04:23
    David Armitage
    1

    Hi,

    Umbraco 13 + IIS

    Not sure what is happening here but what I found works after mutiple attempts is addding this to the web.config that is located in the project root along side all those dlls files.

    PLEASE NOTE

    DO NOT ADD THOSE APPSETTINGS.CONFIG SETTINGS!!!

    When I added those I was getting errors every time. When I just stuck to the web.config settings it worked.

Please Sign in or register to post replies

Write your reply to:

Draft