Detect how long it takes for a file to upload (PHP)
问题 Is it possible to know (serverside) the time it took for a file to upload? I have an image upload API and in my response I'd like to return the upload time (not including script execution time). 回答1: I think yes, there is $_SERVER['REQUEST_TIME'] variable that indicates the start of HTTP request, so on the very beginning of your script: $upload_time = time() - $_SERVER['REQUEST_TIME']; Result will be in seconds. 回答2: Seems this method works pretty OK actually: Send off an ajax request (right