tags:

views:

64

answers:

1

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).

+2  A: 

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.

dev-null-dweller
Thanks, that did the trick!
makeee