File Upload Limit

Q: I’m using code very similar to that in this article ( The problem I have is when I try to upload a 9 MB file, I immediately get “Page cannot be displayed” error. Execution doesn’t even reach the PageLoad() event. The size limit for an IMAGE type in SQL Server 2000 is 2GB+, so size should not be a problem here. When I try the same function for files under 4MB, everything works as expected. What's the problem?

A: Your web application can only upload a file size of 4 MB only. To upload files more than 4mb you have to add option in the web.config file and set the maximum file size there.

In addition, if you're running IIS6, you could be hitting the limit for AspMaxRequestEntityAllowed. If the Content-Length header field of the HTTP request is larger than this limit, the page will bomb out immediately. You can increase the value in IIS6's metabase. For more info, goto


Popular posts from this blog

Working with double quotes (") in VB.Net

Using VB Script to display part of an IP address

Object reference not set to an instance of an object when using HTMLEditorExtender