Wednesday, August 18, 2010

ASP.Net file too large or exceeded buffer (ASP0251)

I've run into this problem a few times.  The problem is ASP's default is to limit the file buffer to 4MB.  If you get a file (or response) larger than that, it will choke.

In IIS6/7, you can run this command:
  • Click Start, click Run, type cmd, and then click OK.
  • cd /d %systemdrive%\inetpub\adminscripts
  • cscript.exe adsutil.vbs SET w3svc/aspbufferinglimit 20000000

I just found the setting in IIS7.5 in IIS Manager:

Sites -> Default Web Site -> Choose your site
Double Click on the "ASP" feature
Expand "Limits Properties"
Change the "Response Buffering Limit"

It defaults to : 4194304 (4MB)
I changed it to 10000000 (10MB) and clicked Apply, but still got the error
Then, I changed it to 20000000 (20MB), and the error went away