I get following error when i upload files larger than 500 MB
"Exception of type 'System.OutOfMemoryException' was thrown. "
My code is shown below:
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);
}
 
     
    