Home Ask Login Register

Developers Planet

Your answer is one click away!

Robba February 2016

How can I pass large values as parameters in ASP.NET WebApi?

I have a WebApi that allows a list of files to be sent to it. The argument is a simple list of objects that contain a name and a list of bytes. When I post small files to it, it works fine, but when I post a large file the method is called, but the parameter is null.

I assume there's a setting or something in the model binding I can change, but I can't figure out what setting to set. Especially since the method itself does get called, but only that parameter gets set to null.

Any help would be appreciated.


Sergei Kuleshov February 2016

I guess it's because you reached maxRequestLength size.

Did you try this approach?


Ivelin Ivanov February 2016

You could try to enlarge the max content request limit. Note that the limit is in bytes. Default IIS 7 limit I think is 30MB.

                <requestLimits maxAllowedContentLength="length"/>

Post Status

Asked in February 2016
Viewed 1,149 times
Voted 4
Answered 2 times


Leave an answer

Quote of the day: live life