简体   繁体   中英

Checking the progress of file download on the server side?

I am trying to build a service which allows to download music files. However after a user pays for a song, I want to be able to verify if the file was completely downloaded by the user or if the download failed in between. How can this be exercised? Thanks.

Theoretically you never know how many remaining packets the client will request. Therefore i see two options:

  1. Dig deeeeep into your server code and come up with some hacky solution that somehow checks sent packets and tries to predict download completion

  2. Write a native application that sends the progress back to the server (of course, then you will not have a web app any more)

As i understand user who pays for music have account on site. If he payed for music, add music to user's music list. And he will be able to download again in future. If download fail for any reason, user can re-download

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM