0

Please help me to work on WebAPI - Need to accept huge data up-to 5MB as input and save (GET). how to enable this feature in API.

Environment: Microsoft.Net, C#

  • 2
    Possible duplicate of [How to set the maxAllowedContentLength to 500MB while running on IIS7?](https://stackoverflow.com/questions/4022434/how-to-set-the-maxallowedcontentlength-to-500mb-while-running-on-iis7) – GSerg Dec 16 '19 at 11:08

1 Answers1

1

By default, the max size of the file is about 4MB (4096 KB), so you need to change the default value size by custom size. You need to change the value of httpRuntime maxRequestLength in your web.config file. following code for setting 2GB.

<system.web>
  <httpRuntime maxRequestLength="2097152" />
</system.web>

Read more about it here: Dealing with large files in ASP.NET

Venkat Singri
  • 104
  • 10
Nenad
  • 119
  • 1
  • 12