File download time in PHP/MySQL

后端 未结 3 376
借酒劲吻你
借酒劲吻你 2021-01-29 15:59

I want to find download time in PHP by sending a request to my MySQL server. I have one table with an href link to download the file. If I click download the download time shoul

3条回答
  •  佛祖请我去吃肉
    2021-01-29 16:29

    Ok, now I understand the question based on OP's comment. The question is how to figure out what time did a user downloaded a file. If that's the case, the download link needs to be a php script, and it would write in the time into db, then returns the content of the file into the stream with proper content header.

    See readfile.

    
    

    All you have to do is pass in the file name as some parameter and write the current time into DB.

提交回复
热议问题