P
Phil Z.
After migrating an ASP.NET 1.1 application to 2.0 we were getting "Cannot
access a closed file" errors when uploading. I found a number of post on
the subject and have since moved from using an Html File Input control to
using the new FileUpload control.
Previously, I had set the maxRequestLength attribute in the machine.config
file to allow 100MB uploads with success. In the v2.0 application I have
added an httpRuntime node to the web.config and have set
maxRequestLength=102400 as before. I also set the
requestLengthDiskThreshold value to 8192.
After doing this, files up to 8192KB in size were uploadable. I have now
found that the requestLengthDiskThreshold is the limiting value. By this I
mean that files that are smaller than the requestLengthDiskThreshold will
upload, while files larger than the requestLengthDiskThreshold setting
throw the "Cannot access a closed file" exception. This has proved true
with a number of different values entered for the threshold.
My understanding is that the requestLengthDiskThreshold value sets the
amount of the request that is cached in memory, and data beyond this value
is temporarily written to disk. Is this correct? Why am I finding that my
file upload size is limited by the requestLengthDiskThreshold setting?
Thanks much -- phil
access a closed file" errors when uploading. I found a number of post on
the subject and have since moved from using an Html File Input control to
using the new FileUpload control.
Previously, I had set the maxRequestLength attribute in the machine.config
file to allow 100MB uploads with success. In the v2.0 application I have
added an httpRuntime node to the web.config and have set
maxRequestLength=102400 as before. I also set the
requestLengthDiskThreshold value to 8192.
After doing this, files up to 8192KB in size were uploadable. I have now
found that the requestLengthDiskThreshold is the limiting value. By this I
mean that files that are smaller than the requestLengthDiskThreshold will
upload, while files larger than the requestLengthDiskThreshold setting
throw the "Cannot access a closed file" exception. This has proved true
with a number of different values entered for the threshold.
My understanding is that the requestLengthDiskThreshold value sets the
amount of the request that is cached in memory, and data beyond this value
is temporarily written to disk. Is this correct? Why am I finding that my
file upload size is limited by the requestLengthDiskThreshold setting?
Thanks much -- phil