.Net Asp.Net MVC C# Development

Downloading functionality in MVC

public FileResult download(string path, string filename)
        {
            byte[] fileBytes = System.IO.File.ReadAllBytes(Server.MapPath(path+"/"+filename));
                return File(fileBytes, System.Net.Mime.MediaTypeNames.Application.Octet, filename);
        }

Leave a Reply

Your email address will not be published. Required fields are marked *