0

My Code:

public FileResult Download(string fileName) {
    string fullPath = Path.Combine(Server.MapPath("~/"), fileName);
    byte[] fileBytes = System.IO.File.ReadAllBytes(fullPath);
    return File(fileBytes,System.Net.Mime.MediaTypeNames.Application.Octet, fileName);
}
Ram Koti
  • 2,203
  • 7
  • 26
  • 36
Ahmed
  • 11
  • 3
  • 1
    Hi @Ahmed, can you please ask a question and provide any context to assist in answering? Thanks! – joshweir Mar 28 '18 at 10:27
  • Hi I am trying to download a large file from server and it is loading in memory first.How can i prevent the whole process from loading in memory? – Ahmed Mar 28 '18 at 10:30
  • Possible duplicate of [What's the fastest way to read a text file line-by-line?](https://stackoverflow.com/questions/8037070/whats-the-fastest-way-to-read-a-text-file-line-by-line) – FCin Mar 28 '18 at 10:45

0 Answers0