开发者

Downloading speed limitation in MVC.NET

开发者 https://www.devze.com 2023-03-12 05:53 出处:网络
I have MVC.NET 2.0 project. It allows clients to download files which are stored on server. I use FileContentResult class for these purposes. How do 开发者_JAVA技巧I can add limitation of maximum down

I have MVC.NET 2.0 project. It allows clients to download files which are stored on server. I use FileContentResult class for these purposes. How do 开发者_JAVA技巧I can add limitation of maximum downloading speed for unregistered users?


This is something you would probably want to accomplish using IIS's Bit Rate Throttling rather than coding it yourself. No need to re-invent the wheel. IIS is also more flexible, easy to change on the fly, and is robust.


There is not automagic way to accomplish this. You will have to take control of the response stream and throttle it. As a quick example, you can look at this URI (notice it is not necessarily THE answer to your problem, but an example): http://www.codeproject.com/KB/IP/Bandwidth_throttling.aspx

Translated, this means is you are not going to solve this through MVC alone.

0

精彩评论

暂无评论...
验证码 换一张
取 消