Home     Products      Support      Corporate     Sign In 
Support Knowledge Base, Article 1182
Product
FileUpEE
Version
Any
Title
Large uploads in ASP.NET fails with the error "System.OutOfMemoryException"
Problem

When doing a large upload in ASP.NET, the transfer fails with the error "System.OutOfMemoryException". The stacktrace contains the following:

[OutOfMemoryException: Exception of type System.OutOfMemoryException was thrown.]

This exception is thrown by the .NET runtime and not our product. The error is caused by .NET reading in the entire contents of a POST into memory. As a result the OutOfMemoryException error message is thrown and the ASP.NET worker process will recycle itself.

Solution

Reading in the entire contents of a request to memory is the default behavior of ASP.NET. This makes it impossible to upload very large files without causing problems. We solve this problem by providing an httpModule which can strip out the files from the upload and cache them to disk before ASP.NET has a chance to read in the request. We then reformat the request and pass it on with the binary data removed, into the .NET application where it is read and processed. The result is that the request .NET sees is only a few kb in size at most, and no memory problems will occur.

For more information on configuring the httpModule, please check our documentation here. If you are already using the httpModule but it does not appear to be working, please check for additional information in the following KB's:

  • KB795 - HowTo: Install the FileUp/FileUpEE HttpModule
  • KB778 - How to integrate FileUpSE/EE samples into Visual Studio .NET for development.
  • KB816 - How do I get the Progress Indicator to show accurate progress in ASP.NET?
  • Docs - Large Uploads in ASP.NET
  • Created : 8/22/2005 2:40:58 PM (last modified : 8/22/2005 3:04:51 PM)
    Rate this article!
    Comments