title: 'System.OutOfMemoryException' was thrown while uploading large file
body: <p>I get following error when i upload files larger than 500 MB</p>
  
  <p>"Exception of type 'System.OutOfMemoryException' was thrown. "</p>
  
  <p>My code is shown below:</p>
  
  <pre><code>public readonly string Filename, ContentType;
  public readonly int Size;
  public readonly byte[] Bytes;
  
  public FileHolder(HttpPostedFile file)
  {
              Filename = Path.GetFileName(file.FileName);
              ContentType = GetContentType(file.ContentType, Filename);
              Size = file.ContentLength;
              Bytes = new byte[file.InputStream.Length];          //Here i get error
              file.InputStream.Read(Bytes, 0, Size);
  }
  </code></pre>