Tuesday, July 7th, 2009
While working with ASP.NET 2.0 I discovered a problem with uploading of a file and processing the stream serverside. After a while I searched for the same problem. The error is got over and over was: System.ObjectDisposedException: Cannot access a closed file. Off-course other people had the same problem and it seems to be that ASP.NET 2.0 handles uploads differently than ASP.NET 1.1.
The following link explains exactly what causes the problem and how to solve it.
Some extra (little) information can be found on the MSDN site.
Posted in .NET Development, ASP.NET | 5 Comments »
Tuesday, July 7th, 2009
In my former post I recommended to read the forum post following the link beneath it. The solution of the problem is to far reading in the post, I decided to put the solution in this new post and explain a little about it. The link further on is to the MSDN online library about this topic.
<httpRuntime executionTimeout="90"
maxRequestLength="4096"
useFullyQualifiedRedirectUrl="false"
requestLengthDiskThreshold="4096"/>
executionTime: The maximum time the upload can take to execute (easy nah).
maxRequestlength: The maximum length in KiloBytes the request me be. By default this is 4096KB (4mb).
useFullyQuallifiedRedirectUrl: Something about a fully qualified url from client redirects (mostly web browser redirects) . By default this settings is "false".
requestLengthDiskThreshold: This one is a bit more nasty. Microsoft says "The number of bytes that indicate the input-stream buffering threshold". The number may never exceeds the maxRequestLength. If so all the bytes are written to disk. This means more space is allocated then needed. So you have created extra space for unwanted activity on your disk. Someone could upload a nasty piece of software in the extra space allocated. By default the size is 256KB. If all these settings have been configured right, you shouldn’t have any problem uploading files which do not exceed the given boundries.
Find more information on MSDN.
Tags: ASP.NET, disk, execution, file, fully, length, max, problem, qualified, redirect, request, time, treshold, upload, url, use
Posted in .NET Development, ASP.NET | 3 Comments »