G
Guest
I'm running into the notorious 4MB upload limit. I see where one answer is
to set a higher limit to the httpRunTime MaxRequestLength setting in
web.config. However this affects the whole application, and if I'm going to
increase this limit, I'd rather only increase it for the one page that needs
it, the one with the FileUpload controls.
So it was great to see the .NET Framework 2.0 now allegedly supports this in
the page. So I tried it (the application is set to the 2.0 Framework,, and
I'm using VS2005). I removed the setting in web.config so that all pages
would default to the 4MB limit. Then, on my page with the FileUpload
controls, I added the following code:
<%@ import Namespace="System.Web.Configuration" %>
Dim httpConfig As HttpRuntimeSection = New HttpRuntimeSection
Sub Page_Load()
httpConfig.MaxRequestLength = 8192
... other code to handle the uploading ...
End Sub
However, it doesn't seem to work. I still get the "Maximum request length
exceeded" errors when I upload a file larger than 4MB.
Am I implementing this properly, or am I missing something?
-Robert-
to set a higher limit to the httpRunTime MaxRequestLength setting in
web.config. However this affects the whole application, and if I'm going to
increase this limit, I'd rather only increase it for the one page that needs
it, the one with the FileUpload controls.
So it was great to see the .NET Framework 2.0 now allegedly supports this in
the page. So I tried it (the application is set to the 2.0 Framework,, and
I'm using VS2005). I removed the setting in web.config so that all pages
would default to the 4MB limit. Then, on my page with the FileUpload
controls, I added the following code:
<%@ import Namespace="System.Web.Configuration" %>
Dim httpConfig As HttpRuntimeSection = New HttpRuntimeSection
Sub Page_Load()
httpConfig.MaxRequestLength = 8192
... other code to handle the uploading ...
End Sub
However, it doesn't seem to work. I still get the "Maximum request length
exceeded" errors when I upload a file larger than 4MB.
Am I implementing this properly, or am I missing something?
-Robert-