I only upload small files to the server.
Where can I remove this restriction?
I put it in web.config, but even if I put big numbers, files, say 100-200 meters are uploaded.
Did like here

<system.web> <compilation debug="true" targetFramework="4.5" /> <httpRuntime targetFramework="4.5" maxRequestLength="2147483647" executionTimeout="1600" requestLengthDiskThreshold="2147483647" /> <security> <requestFiltering> <requestLimits maxAllowedContentLength="2147483647" /> </requestFiltering> </security> ... </system.web> 

Although, the reason, perhaps, in the client ... I do not send the browser, but the program with WebClient. Maybe here somehow it is necessary to register for a larger volume?

  dynamic dyn = JObject.Parse(Params.Data); dynamic dat = new JObject(); using (var client = new HttpClient()) using (var formData = new MultipartFormDataContent()) using (var fileStream = File.OpenRead(dyn.FullPath.ToString())) { HttpContent fileStreamContent = new StreamContent(fileStream); var filename = Path.GetFileName(dyn.FullPath.ToString()); formData.Add(fileStreamContent, "upload", filename);// загрузка var response = client.PostAsync("http://localhost:2613/siteapi/postfile?code="+ dyn.Code.ToString(), formData).Result; //Отправка } 

    1 answer 1

    The answer to the link - an error (and this is stated in the comments)

    httpRuntime and security should be in different sections - system.web and system.webServer respectively:

     <configuration> <system.web> <compilation debug="true" targetFramework="4.5" /> <httpRuntime targetFramework="4.5" maxRequestLength="2147483647" executionTimeout="1600" requestLengthDiskThreshold="2147483647" /> </system.web> <system.webServer> <security> <requestFiltering> <requestLimits maxAllowedContentLength="2147483647" /> </requestFiltering> </security> </system.webServer> </configuration> 

    And yet - maxRequestLength specified in kilobytes; maxAllowedContentLength and requestLengthDiskThreshold are in bytes, so adjust to the same value. requestLengthDiskThreshold does not necessarily maxAllowedContentLength .

    And in general - it is worth setting limits on the basis of the really necessary values, and not just “all 2 gigas each” :)

    • , I put the numbers “under the ceiling”, but the video, 200 meters in size, is not loaded all the way (((I don’t know how to look with the fidler yet. Can it be that the client doesn’t give up? is there a way to change the restriction? Or is it not on the client?) - Rakzin Roman
    • @RakzinRoman You can take and send to another client (better form on the site). Or you can enable failed request tracing on the server and see what exactly prevents the fill. - PashaPash