How to detect when a user has successfully finished downloading a file in php

后端 未结 2 1725
我寻月下人不归
我寻月下人不归 2020-12-01 15:20

I\'ve got a php page which handles requets for file downloads. I need to be able to detect when a file has been downloaded successfully. How can this be done? Perhaps there\

2条回答
  •  独厮守ぢ
    2020-12-01 15:48

    Handle the download in a seperate php script (better do a little more than just readfile($file);, you can also provide the ability to resume downloads like in this question). Then in this script, when you read the last block and send it, you know that all the file was sent. This is not the same as knowing that all was received, but it should be enough for most scenarios.

提交回复
热议问题