In PHP, i will write (create) the file using file_put_contents($filename, $data); It is ok, but i want to detect the finish event of process. Curre
file_put_contents($filename, $data);
Retrieve the Content-Length header from the remote location first. You can use get_headers to do that. Like so:
Content-Length
$headers = get_headers($url, 1); echo "To download: " . $headers['Content-Length'] . " bytes.";