asp.net file downloading - track downloaded size

后端 未结 5 1638
半阙折子戏
半阙折子戏 2021-01-12 08:02

I am trying to design a system for something like this with ASP.net/C#.

The users pay for downloading some content (files- mp3s/PDFs,doc etc).I should be able to tra

5条回答
  •  灰色年华
    2021-01-12 08:43

    you can create an asp.net handler that serves the file ( for asp.net mvc u can do a result action instead ... this is what I'm using). Make sure it supports resumable downloads.

    from the you can track the bytes served.

    Ps. this incurs a performance overhead vs. letting IIS serve it

    update 1: I used something pretty similar to this http://dotnetslackers.com/articles/aspnet/Range-Specific-Requests-in-ASP-NET.aspx ... and the article has a pretty clear explanation on what's inside it. You probably can use that one as is, see the example in that post.

提交回复
热议问题