I have read this article on Codeproject, but I don’t know how to apply it to asp.net MVC 3
http://www.codeproject.com/Articles/18243/Bandwidth-throttling
Here is the code for downloading a file in my project
public ActionResult GetFile(int id)
{
var f = FileAcc.GetInfo(id);
var templateStr = new FileStream(Server.MapPath(f.file_url), FileMode.Open);
return File(templateStr, f.file_name);
}
Please support me on this issue; thanks a lot!
Include
ThrottledStream.csin your project and replace your GetFile method with the following –And tweak bps per your need.