I want to download a file in mvc That size is 200mb
The following error occurs :
System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown
my code is :
public FileResult Download(string name)
{
var videoFilePath = HostingEnvironment.MapPath("~/VideoFile/" + name + ".mp4");
//The header information
var file = new FileInfo(videoFilePath);
//Check the file exist, it will be written into the response
if (file.Exists)
{
return File(videoFilePath, System.Net.Mime.MediaTypeNames.Application.Octet,
file.Name);
}
return null;
}
The error does not occur when the file size is small
why ?
